From: Bart Degryse <Bart.Degryse@indicator.be>
To: pgsql-sql@postgresql.org
Subject: Re: CREATE TABLE
Date: Fri, 09 Mar 2007 15:37:06 +0100
Message-ID: <45F17F21.A3DD.0030.0@indicator.be> (raw)
In-Reply-To: <20070309142103.GB24287@phlogiston.dyndns.org>
References: <00ed01c76252$b0bc28b0$1102a8c0@dream>
<20070309142103.GB24287@ph logiston.dyndns.org>
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 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
---------------------------(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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Bart.Degryse@indicator.be
Subject: Re: CREATE TABLE
In-Reply-To: <45F17F21.A3DD.0030.0@indicator.be>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox