X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DD9DFD1BA6E for ; Thu, 4 Dec 2003 20:48:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20250-01 for ; Thu, 4 Dec 2003 16:47:56 -0400 (AST) Received: from anchor-post-37.mail.demon.net (anchor-post-37.mail.demon.net [194.217.242.87]) by svr1.postgresql.org (Postfix) with ESMTP id 64F17D1B4DE for ; Thu, 4 Dec 2003 16:45:30 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1AS0Lp-000B0S-0b; Thu, 04 Dec 2003 20:45:31 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 8611A17336; Thu, 4 Dec 2003 20:45:23 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 0380E15930; Thu, 4 Dec 2003 20:45:21 +0000 (GMT) From: Richard Huxton To: googlemike@hotpop.com (Google Mike), pgsql-sql@postgresql.org Subject: Re: How Do I Toggle Quoted Identifiers? Date: Thu, 4 Dec 2003 20:45:20 +0000 User-Agent: KMail/1.5 References: <25d8d6a8.0312041142.6ac4a5cd@posting.google.com> In-Reply-To: <25d8d6a8.0312041142.6ac4a5cd@posting.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312042045.20911.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/45 X-Sequence-Number: 16211 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