X-Original-To: pgsql-php@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D3A66475A4B for ; Wed, 14 May 2003 12:46:21 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 91829-07 for ; Wed, 14 May 2003 12:46:20 -0400 (EDT) Received: from strongbad.retrix.com (strongbad.retrix.com [64.69.86.68]) by postgresql.org (Postfix) with ESMTP id 2F04A475921 for ; Wed, 14 May 2003 12:46:20 -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 h4EGmXWb050194 for ; Wed, 14 May 2003 09:48:34 -0700 (PDT) (envelope-from postgres_list@patrickg.com) User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Wed, 14 May 2003 09:46:21 -0700 Subject: Case insensitivity in column and table names From: Patrick Gibson To: Message-ID: 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/12 X-Sequence-Number: 2017 We are in the process of converting some databases from MySQL to PostgreSQL -- our code to access these databases is in PHP. Our convention for column and table names is to use uppercase words. e.g. select ID, USERNAME from USERS where ID=42; (We find that this convention visually makes it easy to see the important details of the query.) In the PHP, we may have something like: $result = mysql_query('select ID, USERNAME from USERS where ID=42'); $row = mysql_fetch_assoc($result); $id = $row['ID']; $username = $row['USERNAME']; We have encountered a big problem when doing the same thing in Postgres, as Postgres seems to lowercase all the column names. Since associative arrays in PHP *are* case-sensitive, all of our existing code thus breaks with the exact same tables. Is there any way possible to get Postgres to preserve the case we give it when we create our tables? I've done many searches, and can't seem to find anything helpful. Surely others have encountered this problem in the past. Thanks, Patrick --- patrick gibson http://patrickgibson.com/