Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id D3B9F9FB667 for ; Fri, 9 Mar 2007 10:37:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 63256-05 for ; Fri, 9 Mar 2007 10:37:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id D33489FB658 for ; Fri, 9 Mar 2007 10:37:20 -0400 (AST) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Fri, 09 Mar 2007 15:24:40 +0100 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Fri, 09 Mar 2007 15:37:18 +0100 Message-Id: <45F17F21.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Fri, 09 Mar 2007 15:37:06 +0100 From: "Bart Degryse" To: Subject: Re: CREATE TABLE References: <00ed01c76252$b0bc28b0$1102a8c0@dream><20070309142103.GB24287@ph logiston.dyndns.org> In-Reply-To: <20070309142103.GB24287@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartAF8B1602.0__=" X-imss-version: 2.046 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.305 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO, HTML_MESSAGE, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200703/109 X-Sequence-Number: 27747 --=__PartAF8B1602.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Because being consistent is easily overlooked I would advise not to quote = the table names Instead of calling your table thisTableIsBig call it this_table_is_big =20 >>> Andrew Sullivan 2007-03-09 15:21 >>> On Fri, Mar 09, 2007 at 02:56:06PM +0100, Shavonne Marietta Wijesinghe = wrote: >=20 > 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. =20 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 --=20 Andrew Sullivan | ajs@crankycanuck.ca=20 The whole tendency of modern prose is away from concreteness. --George Orwell ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly --=__PartAF8B1602.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Because being consistent is easily overlooked I would advise not to = quote the table names
Instead of calling your table thisTableIsBig call it = this_table_is_big
 

>>> Andrew Sullivan <ajs@crankycanuck.ca> = 2007-03-09 15:21 >>>
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 identifier= s 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
correct= ly.

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@cranky= canuck.ca
The whole tendency of modern prose is away from concreteness.<= BR>--George Orwell

---------------------------(end of broadcast)----= -----------------------
TIP 1: if posting/reading through Usenet, = please send an appropriate
       = subscribe-nomail command to majordomo@postgresql.org so that your
 =       message can get through to the mailing list = cleanly
--=__PartAF8B1602.0__=--