dbTalk Databases Forums  

Re: [BUGS] BUG #2764: Capital letter in tables or columns not

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #2764: Capital letter in tables or columns not in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Reece Hart
 
Posts: n/a

Default Re: [BUGS] BUG #2764: Capital letter in tables or columns not - 11-20-2006 , 10:16 PM






On Fri, 2006-11-17 at 19:40 +0000, Ron Teitelbaum wrote:
Quote:
Description: Capital letter in tables or columns not supported
Unquoted identifiers are always smashed down to lowercase. Quoted
identifiers are taken verbatim, including case.

This is not a bug: it's documented in
http://www.postgresql.org/docs/8.1/i...AX-IDENTIFIERS . Oracle has the same behavior, but uppercase unquoted identfiers. I seem to recall reading that the SQL spec requires that identifiers be treated as one or the other, but doesn't say which (upper or lower).

rkh@csb-dev=> create temp table test (lccol text, Uccol text, ALLUCCOL
text, "lccol_q" text, "Uccol_q" text, "ALLUCCOL_q" text);
CREATE TABLE
Time: 233.815 ms

rkh@csb-dev=> \d test
Table "pg_temp_1.test"
Column | Type | Modifiers
------------+------+-----------
lccol | text |
uccol | text |
alluccol | text |
lccol_q | text |
Uccol_q | text |
ALLUCCOL_q | text |


-rEecE (take your pick on case)

--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0
../universe -G 6.672e-11 -e 1.602e-19 -protonmass 1.673e-27 -uspres bush
kernel warning: universe consuming too many resources. Killing.
universe received SIGKILL due to catastrophic leadership. Try -uspres carter.


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #2764: Capital letter in tables or columns not - 11-21-2006 , 09:40 AM






Jaime Casanova wrote:
Quote:
On 11/17/06, Ron Teitelbaum <ron (AT) usmedrec (DOT) com> wrote:

The following bug has been logged online:

Bug reference: 2764
Logged by: Ron Teitelbaum
Email address: ron (AT) usmedrec (DOT) com
PostgreSQL version: 1.4.1
Operating system: Windows
Description: Capital letter in tables or columns not supported
Details:

I ran into a very weird problem that tured out to be a capital letter in the
table name or column name. When trying to query a table with a capital
letter in the name I get error relation not defined.

I can get it to work with something like:
select * from "zipCodes"

It appears to be completely case insensitive if the table is all lowercase.



that's not a bug... if you create a table or column with capital
letters postgres transform it to lowercase...

if you don't want that you need to double quotes...

create table "Foo" (Col1 int);
select * from "Foo";
I added a mention of "capitalization" in the FAQ item on this:

<H3 id="item4.21">4.21) Why are my table and column names not
recognized in my query? Why is capitalization not preserved?</H3>

--
Bruce Momjian bruce (AT) momjian (DOT) us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.