Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAQLdMm34251 for ; Mon, 26 Nov 2001 16:39:26 -0500 (EST) (envelope-from reedstrm@rice.edu) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 3ADE668A0E for ; Mon, 26 Nov 2001 15:39:23 -0600 (CST) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 5810C68A14 for ; Mon, 26 Nov 2001 15:39:22 -0600 (CST) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.22 #1 (Debian)) id 168TTG-0001X6-00 for ; Mon, 26 Nov 2001 15:39:22 -0600 Date: Mon, 26 Nov 2001 15:39:22 -0600 From: "Ross J. Reedstrom" To: pgsql-jdbc@postgresql.org Subject: Re: JDBC bug? Message-ID: <20011126153922.A5801@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , pgsql-jdbc@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.18i X-Virus-Scanned: by AMaViS snapshot-20010714 X-Archive-Number: 200111/286 X-Sequence-Number: 2483 On Mon, Nov 26, 2001 at 03:41:28PM -0500, Colin Freas wrote: > > via quoted mixed case identifiers. I haven't seen any evidence that > > basic SQL operations (select, insert, update, delete) have a bug in them. > > I'd peg a where clause as a basic SQL operation, and be it bug, feature, > annoyance, whatever, it wasn't functioning because of the case of a column > name. > > This worked: > 1. rs = stmt.executeQuery("select * from response"); > > But I wanted to do this, which didn't work: > 2. rs = stmt.executeQuery("select * from response where questionID=16"); > > This is how I got it to work: > 3. rs = stmt.executeQuery("SELECT \"response\".\"questionID\", > \"response\".\"respondentID\", \"response\".\"answer\", \"response\".\"ID\" > FROM \"response\" WHERE "\response\".\"questionID\"=16"); How about: 4. rs = stmt.executeQuery("select * from response where \"questionID\"=16"); Quote what you must, and no more. > > Sorry, does anyone think the third is better than the second? > Yes, since it conforms to SQL92. If you'd bothered to check the postgresql log, you would have seen error messages of the form: test=# select * from response where questionID=16; ERROR: Attribute 'questionid' not found Which would have clued you into what the problem was. Alternatively, try your queries in psql so you can _see_ the responses. Ross -- Ross Reedstrom, Ph.D. reedstrm@rice.edu Executive Director phone: 713-348-6166 Gulf Coast Consortium for Bioinformatics fax: 713-348-6182 Rice University MS-39 Houston, TX 77005