Re: How Do I Toggle Quoted Identifiers?

Поиск
Список
Период
Сортировка
Искать
От
Richard Huxton
Тема
Re: How Do I Toggle Quoted Identifiers?
Дата
Msg-id
200312042045.20911.dev@archonet.com
Ответ на
How Do I Toggle Quoted Identifiers? (googlemike@hotpop.com (Google Mike))
Список
Дерево обсуждения
How Do I Toggle Quoted Identifiers? googlemike@hotpop.com (Google Mike)
Re: How Do I Toggle Quoted Identifiers? Richard Huxton <dev@archonet.com>
Re: How Do I Toggle Quoted Identifiers? Peter Eisentraut <peter_e@gmx.net>
On Thursday 04 December 2003 19:42, Google Mike wrote:
> I'm on PHP 4.2.2 and RedHat 9 with PGSQL. I want to turn quoted
> identifiers off with my SQL queries. What SQL statement or .CONF
> setting do I need to change so that I can turn quoted identifiers off?

Short answer - you don't. Your understanding is correct, basically PG will 
lowercase identifiers unless you quote them, in which case you will want to 
use quotes when accessing them. So...

CREATE TABLE AAA ...
CREATE TABLE "BBB" ...
CREATE TABLE "ccc" ...
SELECT * FROM AAA;   -- works
SELECT * FROM aaa;   -- works
SELECT * FROM "AAA"  -- fails
SELECT * FROM BBB;   -- fails
SELECT * FROM "BBB"; -- works
SELECT * FROM CCC;   -- works
SELECT * FROM "ccc"; -- works
SELECT * FROM "CCC"; -- fails

So long as you don't create your identifiers with quotes, you can refer to 
them as upper/lower case. Personally, I create them all lower-case anyway and 
use caps for SQL keywords.

--  Richard Huxton Archonet Ltd

В списке pgsql-sql по дате отправления
От: Taylor Lewick
Дата:
От: Peter Eisentraut
Дата:
FAQ