X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0B47C9DC81C for ; Tue, 27 Dec 2005 11:34:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39410-06 for ; Tue, 27 Dec 2005 11:34:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svana.org (svana.org [203.20.62.76]) by postgresql.org (Postfix) with ESMTP id A4F1E9DC80C for ; Tue, 27 Dec 2005 11:34:28 -0400 (AST) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1ErGlR-0002I4-00; Wed, 28 Dec 2005 02:29:25 +1100 Date: Tue, 27 Dec 2005 16:29:25 +0100 From: Martijn van Oosterhout To: John McCawley Cc: dfx@dfx.it, pgsql-general@postgresql.org Subject: Re: Case sensitivity? Message-ID: <20051227152919.GB32404@svana.org> Reply-To: Martijn van Oosterhout Mail-Followup-To: John McCawley , dfx@dfx.it, pgsql-general@postgresql.org References: <000501c60b40$ea790510$fc00a8c0@dfx> <43B15A4C.9040809@hardgeus.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MfFXiAuoTsnnDAfZ" Content-Disposition: inline In-Reply-To: <43B15A4C.9040809@hardgeus.com> User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.08 required=5 tests=[AWL=0.080] X-Spam-Score: 0.08 X-Spam-Level: X-Archive-Number: 200512/1178 X-Sequence-Number: 88741 --MfFXiAuoTsnnDAfZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 27, 2005 at 09:14:20AM -0600, John McCawley wrote: > Due to case weirdness in Postgres, particularly when accessing it from=20 > PHP, I completely abandoned mixed case table and column names. I don't= =20 > know if things have changed in the past several years, but when I first= =20 > made the leap, mixed case was more trouble than it was worth. Well, the rule is very simple, either always quote your identifiers, or never quote them. If you always quote them, then you always need to specify them in the same case. If you never quote them, then you always get case-insensetivity. > Even after I got over the initial hump and figured out how to make it=20 > work, there was enough weird behavior (i.e. being able to access a=20 > non-existent array element) in PHP that it led to a lot of bugs when=20 > using mixed-case in Postgres. That's my two cents. Your mileage may=20 > vary... Hmm, you mean how column titles come back as lowercase? By strict SQL standard they should come back as all upper-case, but you probably don't want that either... SQL has always been case-folding, never case-insensetive. Have a nice day, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. --MfFXiAuoTsnnDAfZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDsV3PIB7bNG8LQkwRAl+hAJ4uxrN6cqlOxZ7CuhCsFVf+9K4H/gCdHVDl UblusaMq5l0Z5Wtra5LhNtE= =tUoj -----END PGP SIGNATURE----- --MfFXiAuoTsnnDAfZ--