X-Original-To: pgsql-php@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7BD3C4763D6 for ; Wed, 14 May 2003 13:28:04 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 07866-03 for ; Wed, 14 May 2003 13:28:02 -0400 (EDT) Received: from strongbad.retrix.com (strongbad.retrix.com [64.69.86.68]) by postgresql.org (Postfix) with ESMTP id 1868B4762F1 for ; Wed, 14 May 2003 13:28:02 -0400 (EDT) Received: from [24.68.26.237] (dankwell.patrickg.com [24.68.26.237]) (authenticated bits=0) by strongbad.retrix.com (8.12.6p2/8.12.3) with ESMTP id h4EHU9Wb063878; Wed, 14 May 2003 10:30:10 -0700 (PDT) (envelope-from postgres_list@patrickg.com) User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Wed, 14 May 2003 10:27:56 -0700 Subject: Re: Case insensitivity in column and table names From: Patrick Gibson To: Roj Niyogi Cc: Message-ID: In-Reply-To: <3EC2737A.5060004@pghoster.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/14 X-Sequence-Number: 2019 On 5/14/03 9:48, Roj Niyogi wrote: > You can use quotes around each column to preserve case when creating > your tables in PostgreSQL. That should help retrieval of data via PHP > in the manner you desire. Hi Roj, thanks for the tip. It sort of works: > create table USERS > ( > "ID" int not null primary key, > "EMAIL" varchar(255) not null > ); > insert into USERS values ('1', 'user@email.com'); This query works: > # select * from USERS; > ID | EMAIL > ----+---------------- > 1 | user@email.com ... but: > # select ID, EMAIL from USERS; > ERROR: Attribute "id" not found does not. If I quote the columns like ``select "ID", "EMAIL" from USERS;'' it works, however the same query does not work in MySQL. I'm hoping to find a solution that works with both databases, as we still plan to use MySQL for some stuff. Our framework has some required tables and shared code, so the same queries must work on both. Ultimately if we have to, we will convert everything to lowercase -- but that is really undesirable for us. Any ideas? Thanks, Patrick --- patrick gibson http://patrickgibson.com/