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))
Список pgsql-sql
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"
Дата:
Сообщение: relationship/table design question
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: How Do I Toggle Quoted Identifiers?