Re: Help with queries...

From: "Cristian Prieto" <cristian(at)clickdiario(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help with queries...
Date: 2005-02-24 20:49:53
Message-ID: 063001c51ab2$67e726b0$6e00a8c0@gt.ClickDiario.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The book says:
There is a second kind of identifier: the delimited identifier or quoted
identifier. It is formed by enclosing an arbitrary sequence of characters in
double-quotes ("). A delimited identifier is always an identifier, never a
key word. So "select" could be used to refer to a column or table named
"select", whereas an unquoted select would be taken as a key word and would
therefore provoke a parse error when used where a table or column name is
expected. The example can be written with quoted identifiers like this:

UPDATE "my_table" SET "a" = 5;
Quoted identifiers can contain any character other than a double quote
itself. (To include a double quote, write two double quotes.) This allows
constructing table or column names that would otherwise not be possible,
such as ones containing spaces or ampersands. The length limitation still
applies.

But my table name Grupos is not a reserved keyword, so SELECT * FROM Grupos;
should work, right??? but guess what... It doesn't work too... I need to
pass SELECT * FROM "Grupos";

----- Original Message -----
From: "Michael Fuhr" <mike(at)fuhr(dot)org>
To: "Cristian Prieto" <cristian(at)clickdiario(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, February 24, 2005 2:44 PM
Subject: Re: [GENERAL] Help with queries...

> On Thu, Feb 24, 2005 at 02:33:28PM -0600, Cristian Prieto wrote:
>
>> select * from users;
>> ERROR: relation "users" does not exist
>>
>> but:
>> select * from "Users";
>> returns all the data I want...
>
> See "Identifiers and Keywords" in the "SQL Syntax" chapter of the
> documentation, especially the parts that talk about case and quoting:
>
> http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charl Gerber 2005-02-24 21:00:46 Newbie: help with FUNCTION
Previous Message Joshua D. Drake 2005-02-24 20:49:15 Re: Help with queries...