From adam@labkey.com Tue Aug 3 22:25:24 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4FAF263255E for ; Tue, 3 Aug 2010 19:25:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 10314-01 for ; Tue, 3 Aug 2010 22:25:14 +0000 (UTC) X-Greylist: delayed 00:07:19.423743 by SQLgrey-1.7.6 Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mail.postgresql.org (Postfix) with ESMTP id 9A54E632541 for ; Tue, 3 Aug 2010 19:25:15 -0300 (ADT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 7D94919BC47 for ; Tue, 3 Aug 2010 18:17:54 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 03 Aug 2010 18:17:54 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:subject:date:message-id:mime-version:content-type; s=smtpout; bh=VpY3Pu73dqZ4W+pDwqARzIHdulg=; b=L8GnPkRWbX9Nkz6BNyCT9PmFJdTGVzGLMG2L86tuI0pdLsIlyX/HYbvKzHerBxMTJrhBvJibZ3qAEnV317E610I/clVyEUhwOWEIwfWdjdy8dPj/xD3eRlzMijQQOt3m867XlVVz7xKszdTAlH8dpQHn/CdwY+2S7SX51u869dY= X-Sasl-enc: OrNMwKcnVmJTyryQjAS4IZ5V4GbfJmmzibP0Azw9xigB 1280873874 Received: from AdamE6400 (DHCP155063.FHCRC.ORG [140.107.155.63]) by mail.messagingengine.com (Postfix) with ESMTPSA id 04F484D275F for ; Tue, 3 Aug 2010 18:17:53 -0400 (EDT) From: "Adam Rauch" To: Subject: 9.0 JDBC driver reporting invalid primary key meta data Date: Tue, 3 Aug 2010 15:18:14 -0700 Message-ID: <006901cb3359$c4f493e0$4eddbba0$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_006A_01CB331F.1895BBE0" X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Thread-Index: AcszWcPoE2S2XOKwSSuXM1zW8PrI6A== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201008/10 X-Sequence-Number: 20813 This is a multi-part message in MIME format. ------=_NextPart_000_006A_01CB331F.1895BBE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Requesting primary key meta data via the JDBC driver [i.e., conn.getMetaData().getPrimaryKeys()] against PostgreSQL 9.0 reports incorrect meta data for tables whose PK column(s) has been renamed. I'm testing this against the latest 9.0 driver (http://jdbc.postgresql.org/download/postgresql-9.0dev-800.jdbc4.jar ) and the PostgreSQL 9.0 Beta 4 release. I initially reported this problem during Beta 1 to the pgsql-testers alias; more details and repro code are here: http://archives.postgresql.org/pgsql-testers/2010-05/msg00003.php My understanding is this is an intentional compatibility break by the server team that will require a change to the JDBC driver. The issue is of course trivial to avoid or work around in a test environment, but it's a showstopper for production environments. Many applications like ours must operate on tables, columns, and constraints without any inherent knowledge of or control over these database objects or their history; we rely exclusively on information from the database server and simply can't function with invalid meta data being reported. Let me know if you need more information or if I can help with testing, debugging, etc. Thanks, Adam ------=_NextPart_000_006A_01CB331F.1895BBE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Requesting primary key meta data via the JDBC = driver [i.e., conn.getMetaData().getPrimaryKeys()] against PostgreSQL 9.0 reports incorrect meta data for tables whose PK = column(s) has been renamed. I’m testing this against the latest 9.0 driver = (http://jdbc.postgresql.org/download/postgresql-9.0dev-8= 00.jdbc4.jar) and the PostgreSQL 9.0 Beta 4 release. I initially reported this problem = during Beta 1 to the pgsql-testers alias; more details and repro code are here: = http://archives.postgresql.org/pgsql-testers/2010-05/msg00003.php

 

My understanding is this is an intentional = compatibility break by the server team that will require a change to the JDBC driver. = The issue is of course trivial to avoid or work around in a test = environment, but it’s a showstopper for production environments. Many applications like ours = must operate on tables, columns, and constraints without any inherent = knowledge of or control over these database objects or their history; we rely = exclusively on information from the database server and simply can’t function = with invalid meta data being reported.

 

Let me know if you need more information or if I = can help with testing, debugging, etc.

 

Thanks,

Adam

------=_NextPart_000_006A_01CB331F.1895BBE0-- From books@ejurka.com Fri Aug 6 22:06:46 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 271FA632E1E for ; Fri, 6 Aug 2010 19:06:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 38332-05 for ; Fri, 6 Aug 2010 22:06:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 04070632A27 for ; Fri, 6 Aug 2010 19:06:38 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 51E1E2840E; Fri, 6 Aug 2010 18:06:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=Cn1+NhkPwP02b6gNdv2jaaflm0c=; b=GWtNCM lhXlfOPF6nhSiRn+f/3PPiATFuExHsIEvm3Ye0SPYlf6+4e7VZae5E8e/vSb61pH yx0m4mBHDLmRrotMfAXt2XgbflG4VtrTe7eoch38ZSfqkYDsaD1YN2QgrefqCR1i 2cFxOsS2tTy3v64TJbz2WtNkeKTB8Od7fFgac= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 3990428401; Fri, 6 Aug 2010 18:06:37 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 0CA8AA20F; Fri, 6 Aug 2010 18:06:36 -0400 (EDT) Date: Fri, 6 Aug 2010 18:06:36 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Adam Rauch cc: pgsql-jdbc@postgresql.org Subject: Re: 9.0 JDBC driver reporting invalid primary key meta data In-Reply-To: <006901cb3359$c4f493e0$4eddbba0$@com> Message-ID: References: <006901cb3359$c4f493e0$4eddbba0$@com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/15 X-Sequence-Number: 20818 On Tue, 3 Aug 2010, Adam Rauch wrote: > > Requesting primary key meta data via the JDBC driver [i.e., > conn.getMetaData().getPrimaryKeys()] against PostgreSQL 9.0 reports > incorrect meta data for tables whose PK column(s) has been renamed. I've just checked in a fix for this problem. Also affected are getIndexInfo and getBestRowIdentifier. I've posted a jar file if you'd like to test this on your application. http://www.ejurka.com/pgsql/jars/ar/ Kris Jurka From adam@labkey.com Fri Aug 6 23:34:13 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 39AA16325B0 for ; Fri, 6 Aug 2010 20:34:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 29393-01 for ; Fri, 6 Aug 2010 23:34:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mail.postgresql.org (Postfix) with ESMTP id 02B76632526 for ; Fri, 6 Aug 2010 20:34:05 -0300 (ADT) Received: from compute3.internal (compute3.internal [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id 17DE4190A43; Fri, 6 Aug 2010 19:34:04 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 06 Aug 2010 19:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:cc:references:in-reply-to:subject:date:message-id:mime-version:content-type:content-transfer-encoding; s=smtpout; bh=iiLq6G0O8Gu2pWtuqF8jlMSTszs=; b=GPs7nnrZWHHw95R1xa8yVldGuEPg0/4fCGOGPBSm6yTo1cd4oje0akKR27r7eg8X63/awI1+UNfCQSpFTw4HP2kEkaAR1ZJ0XTz1lq1GGgVNyAY+tsz9UOXsKdRobV/DqGiQ6i3nPyNzLa0DsI6FXwHsau+wMwwiR/ikM76oM9o= X-Sasl-enc: S3lNI5/PDTGEhrSr5VaxmQbv0sF1czsCQsb6u7xy8suJ 1281137643 Received: from AdamE6400 (c-67-185-162-89.hsd1.wa.comcast.net [67.185.162.89]) by mail.messagingengine.com (Postfix) with ESMTPSA id 146584F9F7B; Fri, 6 Aug 2010 19:34:02 -0400 (EDT) From: "Adam Rauch" To: "'Kris Jurka'" Cc: References: <006901cb3359$c4f493e0$4eddbba0$@com> In-Reply-To: Subject: Re: 9.0 JDBC driver reporting invalid primary key meta data Date: Fri, 6 Aug 2010 16:34:25 -0700 Message-ID: <01d201cb35bf$e95ccd70$bc166850$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs1s6fAEsVrTd3lSeOofg54+kdMAAAC6u4g Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.6 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201008/17 X-Sequence-Number: 20820 Preliminary testing shows that this driver fixes the problem! I'll keep testing, but it looks great so far. Thanks so much, Adam -----Original Message----- From: Kris Jurka [mailto:books@ejurka.com] Sent: Friday, August 06, 2010 3:07 PM To: Adam Rauch Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] 9.0 JDBC driver reporting invalid primary key meta data On Tue, 3 Aug 2010, Adam Rauch wrote: > > Requesting primary key meta data via the JDBC driver [i.e., > conn.getMetaData().getPrimaryKeys()] against PostgreSQL 9.0 reports > incorrect meta data for tables whose PK column(s) has been renamed. I've just checked in a fix for this problem. Also affected are getIndexInfo and getBestRowIdentifier. I've posted a jar file if you'd like to test this on your application. http://www.ejurka.com/pgsql/jars/ar/ Kris Jurka