Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by postgresql.org (Postfix) with ESMTP id B6B21475A66 for ; Thu, 21 Feb 2002 16:36:21 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 3.34 #1) id 16e0t0-0008Wi-0X; Thu, 21 Feb 2002 21:36:21 +0000 Received: from localhost ([127.0.0.1] helo=localhost.localdomain ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.34 #1 (Debian)) id 16e0w1-0001dD-00; Thu, 21 Feb 2002 21:39:25 +0000 Subject: Re: SQL: Are the "" around table & coloumnames necessary? From: Oliver Elphick To: Mikey Cc: pgsql-sql@postgresql.org In-Reply-To: <26282372.0202180442.75f0c4c9@posting.google.com> References: <26282372.0202180442.75f0c4c9@posting.google.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2 Date: 21 Feb 2002 21:39:25 +0000 Message-Id: <1014327565.3217.862.camel@linda> Mime-Version: 1.0 X-Archive-Number: 200202/292 X-Sequence-Number: 6715 On Mon, 2002-02-18 at 12:43, Mikey wrote: > Hello, > > when I write a select for example, > it doesn't work this way: > > select col1, col2 > from my_table; > > instead of that I have to write > > select "col1", "col2" > from "my_table"; > > I dont understand this...is there a way to use > the more comfortable form without "" ? The two queries you show are identical. However, if any of the column names contain upper-case characters and were enclosed in double-quotes when the table was created, you will get the behaviour you are complaining about, because all unquoted identifiers are folded to lower-case before the query is executed. The solution is not to use upper-case characters in identifiers. If you already have tables with upper-case names, drop them and recreate them (or do pg_dumpall, edit the dump file and reload the database). -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "My sheep hear my voice, and I know them, and they follow me; And I give unto them eternal life; and they shall never perish, neither shall any man pluck them out of my hand." John 10:27,28