Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B3B1D9FB9F8 for ; Fri, 9 Mar 2007 10:21:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 66151-04-4 for ; Fri, 9 Mar 2007 10:21:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 3A5AD9FB9DD for ; Fri, 9 Mar 2007 10:21:10 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HPgDT-0001jq-LD for pgsql-sql@postgresql.org; Fri, 09 Mar 2007 09:37:07 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 698AC3FAF; Fri, 9 Mar 2007 09:21:03 -0500 (EST) Date: Fri, 9 Mar 2007 09:21:03 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: CREATE TABLE Message-ID: <20070309142103.GB24287@phlogiston.dyndns.org> References: <00ed01c76252$b0bc28b0$1102a8c0@dream> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00ed01c76252$b0bc28b0$1102a8c0@dream> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/107 X-Sequence-Number: 27745 On Fri, Mar 09, 2007 at 02:56:06PM +0100, Shavonne Marietta Wijesinghe wrote: > > But the problem i have is that when i go and open my database in > pgadmin the table name and coloumn name is written in lowercase :( Unquoted identifiers in PostgreSQL are folded to lower case. This is contrary to the SQL spec, but it normally doesn't matter because the rule is applied consistently. Therefore, you have two possibilities: 1. _Never_ quote identifiers. If you do it this way, everything will always be folded to lower case, so your queries will always work correctly. 2. _Always_ quote identifiers. This way, you always get upper case, or mixed case, or lower case, or whatever. Indeed, you can actually have two tables named "mytable" and "MyTable" this way, if you were so inclined/completely mad. The important thing to remember is that you have to pick one style, and be absolutely certain to use it consistently. If you mix the styles, you'll get surprises. A -- Andrew Sullivan | ajs@crankycanuck.ca The whole tendency of modern prose is away from concreteness. --George Orwell