pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedTable names in upper case
2+ messages / 2 participants
[nested] [flat]
* Table names in upper case
@ 2016-10-12 18:12 tosites@me.com
0 siblings, 1 reply; 2+ messages in thread
From: tosites@me.com @ 2016-10-12 18:12 UTC (permalink / raw)
To: pgsql-docs
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
But:
CREATE TABLE client(id INTEGER, name TEXT);
SELECT * FROM CLIENT; -- works
It is, at least, strange.
Cheers.
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Table names in upper case
@ 2016-10-13 07:41 Pantelis Theodosiou <ypercube@gmail.com>
parent: tosites@me.com
0 siblings, 0 replies; 2+ messages in thread
From: Pantelis Theodosiou @ 2016-10-13 07:41 UTC (permalink / raw)
To: tosites@me.com; +Cc: pgsql-docs
On Wed, Oct 12, 2016 at 7:12 PM, <tosites@me.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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-10-13 07:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12 18:12 Table names in upper case tosites@me.com
2016-10-13 07:41 ` Pantelis Theodosiou <ypercube@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox