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

Lists: pgsql-bugs
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
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.