Home > Archive > PostgreSQL Bugs > May 2005 > Re: BUG #1674: CREATE TABLE "name" (with double quotes) and









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: BUG #1674: CREATE TABLE "name" (with double quotes) and
Neil Conway

2005-05-19, 9:23 am

Herman Bos wrote:
> vib=> select * from "bedrag";
> ERROR: relation "bedrag" does not exist


Naturally: there is no such table, regardless of case.

> vib=> select "BEDRAG" from sancties;
> BEDRAG
> --------
> (0 rows)


Not with the SQL you provided:

neilc=# select "BEDRAG" from sancties;
ERROR: relation "sancties" does not exist

> I was wondering if this behavior is correct.


This behavior is intended, although it is true some people find it
confusing. The logic is:

- identifiers specified without double-quotes are folded to lower case
- identifiers specified with double-quotes are not case folded

So your DDL creates a table called SANCTIES since the table name is
double-quoted, whereas "SELECT * FROM SANCTIES" is actually looking for
a table called "sancties". See here for more info:

http://www.postgresql.org/docs/8.0/...TAX-IDENTIFIERS

-Neil

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com