ordering of results returned from DatabaseMetaData.getImportedKeys()

From: peter royal <proyal(at)pace2020(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: ordering of results returned from DatabaseMetaData.getImportedKeys()
Date: 2003-12-31 21:01:54
Message-ID: 8FDC583A-3BD4-11D8-B3DF-000393B61B56@pace2020.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Here's the situation:

I have a table that has multiple foreign keys to another table, and the
key is a composite key (ie multiple fields).

The results returned from DatabaseMetaData.getImportedKeys() seem
"wrong" in that all the KEY_SEQ 1's are returned first and then all the
2's

The results are:

FK_TABLE_NAME FK_COLUMN_NAME PK_TABLE_NAME PK_COLUMM_NAME KEY_SEQ
------------------------------------------------------------------
glsetup acct1loc glaccount gllocnum 1
glsetup acct2loc glaccount gllocnum 1
glsetup acct3loc glaccount gllocnum 1
glsetup acct1num glaccount glmasterid 2
glsetup acct2num glaccount glmasterid 2
glsetup acct3num glaccount glmasterid 2

but i would expect something more like:

FK_TABLE_NAME FK_COLUMN_NAME PK_TABLE_NAME PK_COLUMM_NAME KEY_SEQ
------------------------------------------------------------------
glsetup acct1loc glaccount gllocnum 1
glsetup acct1num glaccount glmasterid 2
glsetup acct2loc glaccount gllocnum 1
glsetup acct2num glaccount glmasterid 2
glsetup acct3loc glaccount gllocnum 1
glsetup acct3num glaccount glmasterid 2

its a simple fix in AbstractJdbc1DatabaseMetaData, I'm just unsure of
whether or not its a valid fix according to the JDBC3 documentation.

This is *ONLY* an issue when you have more than one multi-column FK to
the same table.

So my question is, should the JDBC driver be patched to return what I
expect, or should I modify my code to accommodate what the driver is
returning?
-pete

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message George Lessmann 2003-12-31 21:29:17 Re: odd jdbc driver synchronization issue
Previous Message Dave Cramer 2003-12-31 20:27:49 Re: odd jdbc driver synchronization issue