Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a19c6d

Browse files
author
Dave Cramer
committed
added DISTINCT to the query to get cross reference. This is required when two columns in a table are both foreign keys to another table. From Peter Royal proyal@pace2020.com
1 parent326b2f9 commit6a19c6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,7 @@ protected java.sql.ResultSet getImportedExportedKeys(String primaryCatalog, Stri
29662966
*/
29672967

29682968
if (connection.haveMinimumServerVersion("7.3")) {
2969-
select ="SELECT n1.nspname as pnspname,n2.nspname as fnspname, ";
2969+
select ="SELECTDISTINCTn1.nspname as pnspname,n2.nspname as fnspname, ";
29702970
from =" FROM pg_catalog.pg_namespace n1 "+
29712971
" JOIN pg_catalog.pg_class c1 ON (c1.relnamespace = n1.oid) "+
29722972
" JOIN pg_catalog.pg_index i ON (c1.oid=i.indrelid) "+
@@ -2985,7 +2985,7 @@ protected java.sql.ResultSet getImportedExportedKeys(String primaryCatalog, Stri
29852985
where +=" AND n2.nspname = '"+escapeQuotes(foreignSchema)+"' ";
29862986
}
29872987
}else {
2988-
select ="SELECT NULL::text as pnspname, NULL::text as fnspname, ";
2988+
select ="SELECTDISTINCTNULL::text as pnspname, NULL::text as fnspname, ";
29892989
from =" FROM pg_class c1 "+
29902990
" JOIN pg_index i ON (c1.oid=i.indrelid) "+
29912991
" JOIN pg_class ic ON (i.indexrelid=ic.oid) "+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp