Re: How Do I Toggle Quoted Identifiers? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: How Do I Toggle Quoted Identifiers?
Date
Msg-id 200312042045.20911.dev@archonet.com
Whole thread Raw
In response to How Do I Toggle Quoted Identifiers?  (googlemike@hotpop.com (Google Mike))
List 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 by date:

Previous
From: "Taylor Lewick"
Date:
Subject: relationship/table design question
Next
From: Peter Eisentraut
Date:
Subject: Re: How Do I Toggle Quoted Identifiers?