4 ms·
Original author here, what I'm proposing is an ARRAY[VARCHAR]. Postgres has a native array type, different from manually mangling an array.
by craigkerstiens 10y ago
Original author here, what I'm proposing is an ARRAY[VARCHAR]. Postgres has a native array type, different from manually mangling an array.
- Someone1234 10y agoFair enough. Still an ugly hack, and you're still over stuffing a column. It does avoid some issues with string passing which is nice, but that's just about all it solves.
- endymi0n 10y agoOn top, arrays in PG don't support foreign key constraints and in this way make your model weaker. We do use them too, but in well defined, pretty rare circumstances.
- KurtMueller 10y agoI'm sorry, but I still must disagree with this advice as it pertains to beginners. I would rather a beginner "overnormalize" their database tables rather than have them default to an array column type. It's much easier to transition from "overnormalized" db tables to one that uses array columns when appropriate than it is to go the opposite direction.