Live data from Hacker News

What is better: a lookup table or an enum type?

cybertec-postgresql.com

21–23 of 23 posts

Re: What is better: a lookup table or an enum type?

#21
To me, since the DB is there to serve the app (which is there to serve the user), the lookup/enum decision mostly depends on whether the list is defined before build time (> enum) or after (> lookup). US states are probably a solid "before", so you get the added value of easily materializing a validator in the app code. Children IDs sound a bit more dynamic.
Post reply on HN