4 ms·
99% of PostgreSQL reserved keywords are singular (except `references`), so if you use plural table names, you're more likely to avoid using a reserved keyword (
by elchief 3y ago
99% of PostgreSQL reserved keywords are singular (except `references`), so if you use plural table names, you're more likely to avoid using a reserved keyword (such as `user`)
97% of SQL-92 reserved keywords are also singular (exceptions: constraints, diagnostics, names, references, rows, values)
https://www.postgresql.org/docs/current/sql-keywords-appendix.html https://www.postgresql.org/docs/current/sql-keywords-appendi...
- alerighi 3y agoThis. While naming tables with singular names is the formally correct choices, since the name must be seen as the name of the relation and not of a collection (that is the same name that in a programming language you would choose for a class), in practice there are too many common keywords that are singular, thus you have the choice of choosing plural and still have meaningful names, add a prefix/suffix to all tables, or remembering to quote every time you use a name. I prefer the first, since the second one adds inconvenience and the third one adds possibility of mistakes when you forget to quote it.
- Someone 3y ago> 99% of PostgreSQL reserved keywords are singular (except `references`) It can clash with the plural noun, but ‘References’ is a singular verb conjugation in PostgreSQL, isn’t it?