Thread: Rép. : double quotes around table and column names
The standard is that an identifier (table name, field name, ...) must be double quoted if it contains any non (letter, digits, underscore) character or if it is case sensitive See User guide §1.1.1. Again: use double quoted always or never. Chose never if you can, eg if you use 'classical' table names Use quoting if: - you want to build some very generic tool like an administrator tool, a report generator... - if your app has some weird table names you cannot change So my suggestion is the same as Mike's: avoid double quoting as much as possible. Erwan >>> "Thomas T. Thai" <tom@minnesota.com> 11/21 7:09 >>> What is the suggested way of using double quotes around table and column names? Is there a standard or suggested usage? ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> The standard is that an identifier (table name, field name, ...) must be > double quoted if it contains any non (letter, digits, underscore) > character or if it is case sensitive Is that the SQL standard you are referring to? Because I use underscores extensively without double-quotes with no problems. Greg
On Thu, 21 Nov 2002, Gregory Wood wrote: > > The standard is that an identifier (table name, field name, ...) must be > > double quoted if it contains any non (letter, digits, underscore) > > character or if it is case sensitive > > Is that the SQL standard you are referring to? Because I use underscores > extensively without double-quotes with no problems. I think he's saying if you use something OTHER than a letter, digit or underscore you have to quote it, like create table crazyname&*$#% ... would fail, but create table "crazyname&*$#%" ... would work.