(JDBC) KEY_SEQ in Foreign Key result set starts at 0, should be 1

From: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: (JDBC) KEY_SEQ in Foreign Key result set starts at 0, should be 1
Date: 2002-02-15 11:46:10
Message-ID: 200202151146.g1FBkBE37901@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Using the JDBC interface to inspect the metadata in a table, the
ResultSet returned from using DatabaseMetaData.getImportedKeys
includes values for KEY_SEQ. This is an integer value and in the
case of Postgreql starts at zero.

I can find no formal definition of where this value should start
but the ODBC rules explicitly state that it should start at 1 and
both DB/2 and MySQL seem to agree.

To fix this line 2437 of jdbc2/DatabaseMetaData.java needs to be
changed from:-

short seq = 0;

to:-

short seq = 1;

The same change is required in jdbc1/DatabaseMetaData.java.

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-02-15 11:51:07 Bug #589: JDBC KEY_SEQ in getImportedKey starts at 0
Previous Message Ruud van den Brink 2002-02-15 11:45:41 Bug in Postrgresql 7.2 migrating from 7.1.3