6 ms·
For those (like me) who are wary of enums, it's very simple to create a tiny table with one column of distinct string values. Future-proof and serves the same f
by glancast 8y ago
For those (like me) who are wary of enums, it's very simple to create a tiny table with one column of distinct string values. Future-proof and serves the same function if you add not-null foreign key constraints to your dependent tables.
- jdfellow 8y agoI may be mistaken, but I believe under the hood Postgres enums work in a very similar way to this, only the strings are interred instead of duplicated across your tables.
- glancast 8y agoYes, that's true. I'm paying the small duplication cost in exchange for removing enums' cumbersome limitations. Not saying I never use them, but I usually end up regretting it when I do :)