Re: Without schemas

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: Félix Sánchez Rodríguez <fesanch(at)ciego(dot)cult(dot)cu>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Without schemas
Date: 2009-04-01 22:51:14
Message-ID: 49D3A992.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>> Félix Sánchez Rodríguez <fesanch(at)ciego(dot)cult(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2009-04-01 23:31:26 Re: Vacuum Full
Previous Message Daniel J. Summers 2009-04-01 22:34:09 Re: Without schemas