Received: from barry.xythos.com ([64.139.0.223]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAQKAgm27350 for ; Mon, 26 Nov 2001 15:10:42 -0500 (EST) (envelope-from barry@xythos.com) Received: from xythos.com (localhost.localdomain [127.0.0.1]) by barry.xythos.com (8.11.6/8.11.6) with ESMTP id fAQK9Kx09526; Mon, 26 Nov 2001 12:09:20 -0800 Message-ID: <3C02A170.8060205@xythos.com> Date: Mon, 26 Nov 2001 12:09:20 -0800 From: Barry Lind User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120 X-Accept-Language: en-us MIME-Version: 1.0 To: Bruce Momjian CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC bug? References: <200111261917.fAQJHVa09726@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200111/275 X-Sequence-Number: 2472 I haven't seen any evidence in this thread of a JDBC bug. The original posting refered to calls in the DatabaseMetaData classes doing toLowerCase(). This is appropriate because the DatabaseMetaData class is querying the pg_* tables to get information about database objects, thus since the backend stores the identifiers in lower case, therefore the jdbc code needs to do a toLowerCase(). The followup below is more of a complaint on how SQL is case insensitive and if you have created your objects with quoted mixed case identifiers you need to access them via quoted mixed case identifiers. I haven't seen any evidence that basic SQL operations (select, insert, update, delete) have a bug in them. thanks, --Barry Bruce Momjian wrote: >>>>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. > >