Re: Problem with getImportedKeys / getExportedKeys
От | Jason Davies |
---|---|
Тема | Re: Problem with getImportedKeys / getExportedKeys |
Дата | |
Msg-id | 20020115142603.B11613@netspade.com обсуждение исходный текст |
Ответ на | Re: Problem with getImportedKeys / getExportedKeys ("Vianen, Jeroen van" <jeroen.van.vianen@satama.com>) |
Список | pgsql-jdbc |
Yes, at the moment they are the wrong way round because of a misinterpretation on my part. Easily fixed, by changing theSQL 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@netspade.com
Вложения
В списке pgsql-jdbc по дате отправления: