Re: Help with queries... - Mailing list pgsql-general

From Cristian Prieto
Subject Re: Help with queries...
Date
Msg-id 063001c51ab2$67e726b0$6e00a8c0@gt.ClickDiario.local
Whole thread Raw
In response to Help with queries...  ("Cristian Prieto" <cristian@clickdiario.com>)
Responses Re: Help with queries...  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Help with queries...  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@fuhr.org>
To: "Cristian Prieto" <cristian@clickdiario.com>
Cc: <pgsql-general@postgresql.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/
>



pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Help with queries...
Next
From: Charl Gerber
Date:
Subject: Newbie: help with FUNCTION