pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Colin Freas <cef6@georgetown.edu>
Cc: Nate Gelbard <gelbardn@tripwire.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC bug?
Date: Mon, 26 Nov 2001 14:17:31 -0500 (EST)
Message-ID: <200111261917.fAQJHVa09726@candle.pha.pa.us> (raw)
In-Reply-To: <IIEPJDIJEEBPKJGDFFBEEEDLCAAA.cef6@georgetown.edu>

> >> So does postgres not support mixed case in table names, or the backend
> >> does but the clients dont, or what?
> >
> >Well, we support mixed case identifiers, but they need to be
> >double-quoted, as you saw.  The \d behavior looks correct.  The jdbc
> >issue looks more complicated because we are forcing lowercase in the
> >jdbc code.  Perhaps some jdbc folks can comment on that.
> 
> I think Nate's being kind calling this an annoyance.  I may have missed
> something in the docs, but I just spent a few frustrating hours confronting
> a similar issue with tables of mixed case.  Everything was working correctly
> with my servlet, except when I referenced a column with a name like
> questionID in a where clause.  Note the casing.  I had no idea this is what
> was wrong until, other ideas exhausted, I recreated my query text with
> pgadmin's query wizard and it put quotes around everything in the SQL it
> generated.
> 
> Is there a pqsql-jdbc log somewhere that this might have shown up?  I was so
> sure it was my java code (which in the end it was, sort of :) I never
> bothered to check any Postgres logs.  Would it have shown up somewhere
> there?  Either way, personally, I think this isn't the best behavior.  I
> don't want to get into a casing flame war, but, I would've expected an
> exception if it couldn't figure out what was happening with the where
> clause, something at least.

Yes, I agree, it clearly looks like a jdbc bug.  If you have created
mixed-case identifiers, the jdbc toLower call make accessing it
impossible.  If we can trust the case of the indentifier supplied, we
can just put double-quotes around it to preserve the case as passed to
the backend.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (23+ messages)  latest in thread

Message-ID: <200111261917.fAQJHVa09726@candle.pha.pa.us>
Permalink:  ../200111261917.fAQJHVa09726@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200111261917.fAQJHVa09726@candle.pha.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pgman@candle.pha.pa.us, cef6@georgetown.edu, gelbardn@tripwire.com
  Subject: Re: JDBC bug?
  In-Reply-To: <200111261917.fAQJHVa09726@candle.pha.pa.us>
  References: <IIEPJDIJEEBPKJGDFFBEEEDLCAAA.cef6@georgetown.edu> <200111261917.fAQJHVa09726@candle.pha.pa.us>

* 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