3 ms·
Plural table names seem to be all over the PostgreSQL docs. Who recommends against using plural names for tables?
by rcahearn 13y ago
Plural table names seem to be all over the PostgreSQL docs. Who recommends against using plural names for tables?
- saurik 13y agoI have seen this recommendation many times in PostgreSQL circles (well, I've also seen it sometimes in general SQL circles, but it is much rarer) due to PostgreSQL being an OODBMS: "tables" are just "types" in PostgreSQL, which with plural table names leads to awkward situations where you might be casting a value--a value that represents a single user--to the type "users". Or you write a function that returns a single user: it is confusing to have the return type of that function be "users". The "setof" type operator also makes a little more sense if the type argument is singular.