Omitting the double quote to do query on PostgreSQL

Postgresql has some particular behaviour in regard to quoting and case sentivity: it folds every non-quoted identifier to lower case (also at creation time) and then works case-sensitively.

Double quotes in identifiers are only needed when the identifier (table name, column name, etc) was defined (at schema creation time) with uppercase letters (some or all) and between double quotes.

In that case (which I advice against), when you use that identifier, you must type it in the same way: case sensitively (type upper/lower case letter exactly as defined) and between double quotes.

In other cases, you can use non-quoted identifiers and work always case-insensitively.


Your problem with this query started when you created your table. When you create your table, don't use quotes.

Use this:

CREATE TABLE a ( ... );

Not this:

CREATE TABLE "A" ( ... );

The latter will make it so that you always have to quote it later. The former makes it a normal name and you can use SELECT * FROM a; or SELECT * FROM A;

If you can't just recreate your table, use the ALTER TABLE syntax:

ALTER TABLE "A" RENAME TO a;

Don't use upper case letter in your table name or it's column name, if you are using such thing then the postgres will required double quote for accessing it.


double quotes are required if you include capital letters in your table name in postgres

to avoid the requirements name your table "a"