views:

27

answers:

2

I designed a set of tables in pgAdmin3. I gave names like Products and ProductRID. I was very surprised though when I went to query this table only to find a query like this yielded unknown relation:

select * from Products

Apparently the proper way to access this is

select * from "Products"

which is very ugly. I can rename the tables to all lower case to query without quotes, but then it looks ugly. Is there any kind of a setting so that it will retain the case, but behave without case sensitivity?

+1  A: 

You may check the relative wiki to get the precise answer

Why are my table and column names not recognized in my query? Why is capitalization not preserved?

Hope it clarifies.

Igor
heh. so that's it, by-design?
Earlz
+3  A: 

No there is no magic setting. The best way to deal with case sensitivity is to not quote your relations when you are creating them. If you are early on in schema design, go ahead and rename them (and column names) to lower case. The "looks ugly" problem will go away because in your queries you can still do "SELECT * FROM Products" and it will work fine.

Scott Bailey