Convention Over Configuration in the Db World

Responding to another Flaming Spork post, this one about [http://www.flamingspork.com/blog/2006/04/19/postgresql-73-sql-key-words/ difficulties involved in doing some cross platform testing between mysql and PostgreSQL], the answer is to not use the word user as a table name. If you look at the [http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html doc url] listed at the top of the post, you’ll note that this choice wasn’t just some quirky idea of the PostgreSQL developers, but rather that USER is a reserved keyword in both SQL92 and SQL99; ergo don’t use it for your applications, it is just a bad idea. (Actually this applies to his integer(10) thing too, which afaict is an ugly mysql hack) And before anyone points out that technically one could conform to the SQL standards by lowercasing and quoteing (ie. “user”) ask yourself this: why would you do that? The only thing that will follow are problems as you’ve now forced every application writer to quote the table name in order to do anything with it; and believe me, in some languages when you are building queries on the fly, having to toss in extra quotes for a single table will cause some measurable annoyances, and for what? The Rails mantra of [http://www.karmacrash.com/articles/2005/09/27/readingonrails-8-convention-over-configuration Convention over configuration] should be applied here, and the convention should be to avoid using any of the SQL reserved words as object names. (As a side note, say what you will about Rails active record pattern, but it actually conforms to this idea by prefering plural table names over singular names avoiding all of the SQL reserved words)