Re: Without schemas - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: Without schemas
Date
Msg-id 49D3A992.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Without schemas  (Félix Sánchez Rodríguez <fesanch@ciego.cult.cu>)
List pgsql-admin
>>> Félix Sánchez Rodríguez <fesanch@ciego.cult.cu> wrote:
> I've figured out that it's not the same to use 'SELECT NICK FROM
> USUARIOS' vs. 'SELECT "Nick" from "Usuarios"'

In PostgreSQL the first is interpreted the same as:

SELECT "nick" from "usuarios";

Note that this is different from the ANSI & ISO standards, which
require it to be interpreted as:

SELECT "NICK" FROM "USUARIOS";

Neither of the above would find a column "Nick" or a table "Usuarios".

For maximum portability, you might want to always quote your
identifiers, regardless of whether they are all uppercase, all
lowercase, or mixed case.  An alternative, which has worked for some,
is to never quote your identifiers and always use lower case.  I've
seen software which breaks without the quotes on either
capitalization, but the lowercase is currently more popular in more
quarters, and seems to break less often.  It's certainly safe it
you're planning to target PostgreSQL and don't care about portability.

-Kevin

pgsql-admin by date:

Previous
From: "Daniel J. Summers"
Date:
Subject: Re: Without schemas
Next
From: Scott Marlowe
Date:
Subject: Re: Vacuum Full