This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Guys, this is one of the important discussion of PostgreSQL.
All identifiers, including column name, are Case-Sensitive in PostgreSQL?
Yes: when you define identifier in the double-quote, it is a Case-Sensitive.
No: when you do not use double-quote for an identifier, it is not a Case-Sensitive.
For example:
With double-quoted:
1 2 3 |
CREATE TABLE "Test" (rno integer); SELECT *FROM Test /*True...*/ SELECT *FROM test; /*False...not work*/ |
Without double-quoted:
1 2 3 4 |
CREATE TABLE Test(rno integer); SELECT *FROM Test /*True...*/ SELECT *FROM teST /*True...*/ SELECT *FROM test /*True...*/ |
My advice: Never use double-quoted for any identifiers. Otherwise, you will face the problem of case-sensitivity.
When you do not use double-quoted, PostgreSQL internally store all identifiers in small latter and you can access those all identifiers in any case.
When you create your table using PGAdmin UI, by default it creates all identifiers with double-quoted.
Always try to create your database objects by using the SQL script.