From: | Jason Davies <jason(at)netspade(dot)com> |
---|---|
To: | "Vianen, Jeroen van" <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-15 20:26:03 |
Message-ID: | 20020115142603.B11613@netspade.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Yes, at the moment they are the wrong way round because of a misinterpretation on my part. Easily fixed, by changing the SQL part so that the Java code reads:
...
+ ((primaryTable != null) ? "AND c.relname='" + primaryTable + "' " : "")
+ ((foreignTable != null) ? "AND c2.relname='" + foreignTable + "' " : "")
...
I've attached a patch for this for now. But maybe case-sensitive stuff needs to be resolved?
Thanks,
Jason Davies
>
> Oh, that was to get it working on Oracle :-( But glad you pointed it out,
> 'cause the output is way different now:
>
> PostgreSQL says:
>
> # java -classpath jdbc7.2dev-1.2.jar:. TestKeys users
> Imported keys:
> PKTABLE_NAME = users_roles
> PKCOLUMN_NAME = userid
> FKTABLE_NAME = users
> FKCOLUMN_NAME = userid
> Exported keys:
>
> # java -classpath jdbc7.2dev-1.2.jar:. TestKeys users_roles
> Imported keys:
> Exported 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
>
>
> Whereas Oracle says:
>
> # java -classpath classes12.zip:. TestKeys USERS
> Imported keys:
> Exported keys:
> PKTABLE_NAME = USERS
> PKCOLUMN_NAME = USERID
> FKTABLE_NAME = USERS_ROLES
> FKCOLUMN_NAME = USERID
>
> # java -classpath classes12.zip:. TestKeys USERS_ROLES
> Imported keys:
> PKTABLE_NAME = ROLES
> PKCOLUMN_NAME = ROLENAME
> FKTABLE_NAME = USERS_ROLES
> FKCOLUMN_NAME = ROLENAME
> PKTABLE_NAME = USERS
> PKCOLUMN_NAME = USERID
> FKTABLE_NAME = USERS_ROLES
> FKCOLUMN_NAME = USERID
> Exported keys:
>
>
> The new TestKeys.java is attached.
>
> Cheers,
>
>
> Jeroen
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
Jason Davies
jason(at)netspade(dot)com
Attachment | Content-Type | Size |
---|---|---|
tmp | text/plain | 2.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter E. Chen | 2002-01-15 21:12:35 | Question regarding whether the Postgres JDBC driver supports password encryption . . . |
Previous Message | Alaric B. Snell | 2002-01-15 20:07:42 | Re: Explicit typing of numeric types |