pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow Do I Toggle Quoted Identifiers?
3+ messages / 3 participants
[nested] [flat]
* How Do I Toggle Quoted Identifiers?
@ 2003-12-04 19:42 Google Mike <googlemike@hotpop.com>
2003-12-04 20:45 ` Re: How Do I Toggle Quoted Identifiers? Richard Huxton <dev@archonet.com>
2003-12-04 20:54 ` Re: How Do I Toggle Quoted Identifiers? Peter Eisentraut <peter_e@gmx.net>
0 siblings, 2 replies; 3+ messages in thread
From: googlemike@hotpop.com @ 2003-12-04 19:42 UTC (permalink / raw)
To: pgsql-sql
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?
Quoted identifiers, as I understand them, are where you must put
double quotes around any table or column name in order to preserve its
case, or in order to preserve an internal space it may have in the
identifier name.
I was looking for something like:
SET QUOTED_IDENTIFIERS = OFF;
SELECT Username FROM Logins;
For that matter, how do I turn case-sensitivity off?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How Do I Toggle Quoted Identifiers?
2003-12-04 19:42 How Do I Toggle Quoted Identifiers? Google Mike <googlemike@hotpop.com>
@ 2003-12-04 20:45 ` Richard Huxton <dev@archonet.com>
1 sibling, 0 replies; 3+ messages in thread
From: Richard Huxton @ 2003-12-04 20:45 UTC (permalink / raw)
To: googlemike@hotpop.com; 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How Do I Toggle Quoted Identifiers?
2003-12-04 19:42 How Do I Toggle Quoted Identifiers? Google Mike <googlemike@hotpop.com>
@ 2003-12-04 20:54 ` Peter Eisentraut <peter_e@gmx.net>
1 sibling, 0 replies; 3+ messages in thread
From: Peter Eisentraut @ 2003-12-04 20:54 UTC (permalink / raw)
To: Google Mike <googlemike@hotpop.com>; +Cc: pgsql-sql
Google Mike writes:
> 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?
There is no setting for that.
> For that matter, how do I turn case-sensitivity off?
There is no setting for that either.
--
Peter Eisentraut peter_e@gmx.net
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-12-04 20:54 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-04 19:42 How Do I Toggle Quoted Identifiers? Google Mike <googlemike@hotpop.com>
2003-12-04 20:45 ` Richard Huxton <dev@archonet.com>
2003-12-04 20:54 ` Peter Eisentraut <peter_e@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox