| From: | Pantelis Theodosiou <ypercube(at)gmail(dot)com> |
|---|---|
| To: | tosites(at)me(dot)com |
| Cc: | pgsql-docs(at)postgresql(dot)org |
| Subject: | Re: Table names in upper case |
| Date: | 2016-10-13 07:41:44 |
| Message-ID: | CAE3TBxyjqaQkg55pKdq12LynGwi9a2tU1wk_c3xn=WyO-fCa9A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-docs |
On Wed, Oct 12, 2016 at 7:12 PM, <tosites(at)me(dot)com> wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html
> Description:
>
> Although this documentation says that "Key words and unquoted
> identifiers
> are case insensitive." it is not possible to use table or column
> names in
> upper case.
>
> If the table or column name was in upper case it is necessary use quotes to
> Postgres accept. Exactly the opposite case showed at documentation.
>
> For example:
>
> CREATE TABLE CLIENT(ID INTEGER, NAME TEXT);
>
> SELECT * FROM CLIENT; -- an error will be launched
>
> SELECT * FROM "CLIENT"; -- works
>
Are you sure about the CREATE TABLE statement you used? Which version and
OS?
Because this is what I get, which matches exactly the documented behaviour
(9.5.4, Ubuntu):
x=# CREATE TABLE CLIENT(ID INTEGER, NAME TEXT);
CREATE TABLE
x=# select * from client ;
id | name
----+------
(0 rows)
x=# select * from "CLIENT" ;
ERROR: relation "CLIENT" does not exist
LINE 1: select * from "CLIENT" ;
^
x=#
Pantelis Theodosiou
| From | Date | Subject | |
|---|---|---|---|
| Next Message | joanmi | 2016-10-13 07:48:37 | Parallel queries on CTE for writing operations. |
| Previous Message | rauldmiller | 2016-10-13 01:05:44 | date ambiguity in view documentation |