Re: Problem with getImportedKeys / getExportedKeys

From: Jason Davies <jason(at)netspade(dot)com>
To: Jeroen van Vianen <jeroen(dot)van(dot)vianen(at)satama(dot)com>
Cc: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem with getImportedKeys / getExportedKeys
Date: 2002-01-18 00:06:51
Message-ID: 20020117180651.A25708@netspade.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I've fixed it completely now (I think) - it took more changes than I thought would be necessary. Here is a new patch (against current CVS). Once it has been tested it should be commited to CVS as it is quite an important fix.

This patch makes getImportedKeys() and getExportedKeys() report the correct relationships (they were the wrong way round before) and correct number of keys.

Thanks,
Jason Davies

On Thu, Jan 17, 2002 at 08:00:48PM +0100, Jeroen van Vianen wrote:
> Hi Jason,
>
> At 20:06 01-16-2002 +0100, Vianen, Jeroen van wrote:
> >Thanks for the patch. I will try it out soon.
>
> I've tried your patch and the output is as follows:
>
> java -classpath .:postgresql.jar TestKeys users
> Imported keys:
> Exported keys:
> PKTABLE_NAME = users_roles
> PKCOLUMN_NAME = userid
> FKTABLE_NAME = users
> FKCOLUMN_NAME = userid
>
> # java -classpath .:postgresql.jar TestKeys users_roles
> Imported keys:
> PKTABLE_NAME = users_roles
> PKCOLUMN_NAME = userid
> FKTABLE_NAME = users
> FKCOLUMN_NAME = userid
> PKTABLE_NAME = users_roles
> PKCOLUMN_NAME = userid
> FKTABLE_NAME = users
> FKCOLUMN_NAME = userid
> Exported keys:
>
> Comparing this with Oracle's output I noticed that all PK* and FK* columns
> have been exchanged and that the two imported keys for table users_roles
> are the same. Oracle correctly reports a key from users_roles to users and
> from users_roles to roles.
>
> Any clue?
>
>
> Jeroen
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Jason Davies

jason(at)netspade(dot)com

Attachment Content-Type Size
DatabaseMetaData.java.diff text/plain 11.4 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paulo J. Matos 2002-01-18 00:37:56 Postgres-jdbc example!
Previous Message Jeroen van Vianen 2002-01-17 19:00:48 Re: Problem with getImportedKeys / getExportedKeys