dbTalk Databases Forums  

[BUGS] BUG #2598: Columns named R are not accessible - although R is not a keyword

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


Discuss [BUGS] BUG #2598: Columns named R are not accessible - although R is not a keyword in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andreas Langegger
 
Posts: n/a

Default [BUGS] BUG #2598: Columns named R are not accessible - although R is not a keyword - 08-30-2006 , 10:21 AM







The following bug has been logged online:

Bug reference: 2598
Logged by: Andreas Langegger
Email address: al (AT) jku (DOT) at
PostgreSQL version: 8.1
Operating system: Gentoo Linux 3.3.6, Kernel 2.6.16
Description: Columns named R are not accessible - although R is not a
keyword
Details:

It seems that the column name "R" or "r" is reserved. If I want to insert
tuples I get the error message:

ERROR: column "r" of relation "xyz" does not exist

And if I alter the column name to "a" it works. Again, renaming to "R" or
"r", same error. But it's not announced to be a name conflict / reserved
keyword...

Regards,
Andy

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2598: Columns named R are not accessible - although R is not a keyword - 08-30-2006 , 10:49 AM






"Andreas Langegger" <al (AT) jku (DOT) at> writes:
Quote:
It seems that the column name "R" or "r" is reserved.
Hardly.

Quote:
If I want to insert tuples I get the error message:

ERROR: column "r" of relation "xyz" does not exist
Worksforme:

regression=# create table xyz(r int);
CREATE TABLE
regression=# insert into xyz(r) values(42);
INSERT 0 1

Perhaps you could provide a self-contained test case?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2598: Columns named R are not accessible - although R is not a keyword - 08-30-2006 , 12:01 PM



Andreas Langegger <al (AT) jku (DOT) at> writes:
Quote:
Well, I also tried your simple regression test and it worked. The more
I'm wondering why this does not:

CREATE TABLE sunspots
...
"R" int2,
"R" with double quotes represents capital R, but when you write R
without quotes in a query, it's implicitly downcased. See
http://www.postgresql.org/docs/8.1/s...AX-IDENTIFIERS

If you spell it like that in the table definition then you'll need
to use quotes every time you refer to the column, too.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


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.