9.0 JDBC driver reporting invalid primary key meta data - Mailing list pgsql-jdbc

From Adam Rauch
Subject 9.0 JDBC driver reporting invalid primary key meta data
Date
Msg-id 006901cb3359$c4f493e0$4eddbba0$@com
Whole thread Raw
Responses Re: 9.0 JDBC driver reporting invalid primary key meta data
List pgsql-jdbc

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

pgsql-jdbc by date:

Previous
From: Alexander Yerenkow
Date:
Subject: Re: "Mons" in JDBC driver
Next
From: Jason Tesser
Date:
Subject: 9.0 Driver