Re:Mistakes Beginners Make When Working with Databases
by craigkerstiens on Wednesday June 08, 2016 @12:26PM
(#11863395)
Original author here, what I'm proposing is an ARRAY[VARCHAR]. Postgres has a native array type, different from manually mangling an array.
[ Parent
| on HN ]
Re:Mistakes Beginners Make When Working with Databases
by Someone1234 on Wednesday June 08, 2016 @12:28PM
(#11863421)
Fair 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.
Re:Mistakes Beginners Make When Working with Databases
by endymi0n on Wednesday June 08, 2016 @01:01PM
(#11863705)
On 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.
Re:Mistakes Beginners Make When Working with Databases
by KurtMueller on Wednesday June 08, 2016 @02:12PM
(#11864268)
I'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.