X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 59F34D1B7BF for ; Thu, 24 Jun 2004 11:50:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05178-06 for ; Thu, 24 Jun 2004 14:50:26 +0000 (GMT) Received: from sycorax.affordablehost.com (sycorax.affordablehost.com [216.46.192.84]) by svr1.postgresql.org (Postfix) with ESMTP id 0E04CD1B2BD for ; Thu, 24 Jun 2004 11:50:20 -0300 (ADT) Received: from h0040054d8ee4.ne.client2.attbi.com ([66.31.57.228] helo=e-greek.net) by sycorax.affordablehost.com with esmtp (TLSv1:RC4-MD5:128) (Exim 4.24) id 1BdVYV-0000Yi-Vq; Thu, 24 Jun 2004 10:50:24 -0400 Message-ID: <40DAEA31.1090508@e-greek.net> Date: Thu, 24 Jun 2004 10:50:25 -0400 From: Andrew Biagioni User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, it, it-ch, fr-fr, fr-ch, de-de, de-ch MIME-Version: 1.0 To: Hemapriya Cc: pgsql-admin@postgresql.org Subject: Re: Database, Table Names are resulting in lowercase References: <20040624141414.77975.qmail@web21324.mail.yahoo.com> In-Reply-To: <20040624141414.77975.qmail@web21324.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sycorax.affordablehost.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - e-greek.net X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/325 X-Sequence-Number: 13985 If you specify an object's name without quoting it, e.g.: ALTER TABLE MyTable ADD COLUMN MyNewCol INT4; then it is read as all lower case. This means, that table "mytable" will be altered, and the new column will be called "mynewcol". To force mixed or upper case, you quote the names, e.g.: ALTER TABLE "MyTable" ADD COLUMN "MyNewCol" INT4; This will alter only a table called "MyTable", and table "mytable" will not be altered. The new column will be called "MyNewCol". IMHO, this system allows you to have mixed/upper case if you need it, but keeps things simpler if you don't need it by avoiding case-sensitive confusion. You can keep your SQL code more readable by adopting case-specific name conventions (in the above examples, the SQL keywords are all in upper case and the names all mixed or lower case), without worrying about the objects getting created in a jumble of different cases (if, e.g., a previous DBA used a different case convention from the new DBA). In my experience the only use for true mixed-case names are when I import a table from another database, e.g. MS SQL Server or Access; at that time it's essential to have the quoting mechanism to ALLOW me to specify a truly-mixed-case table or column name, since the import mechanisms tend to preserve the true name case which in MS are often mixed-case. Hope this helps, Andrew Hemapriya wrote: >Hi All, > >We have postgresql running in mac. I found whatever db >objects i create from the sql prompt results >in lowercase. Can anyone tell me why it is happening.? >does postgres stores the db objects in lowercase >internally.. > >If i create something from the shell prompt it remains >in the same case i used. Can anyone tell me what is >the case limitations we have in postgres for >db,table,column names,etc. > >Thanks >Priya > > > > > > > >__________________________________ >Do you Yahoo!? >New and Improved Yahoo! Mail - 100MB free storage! >http://promotions.yahoo.com/new_mail > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > > >