mirror of
https://github.com/postgres/postgres.git
synced 2026-04-25 16:18:21 -04:00
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
This commit is contained in:
parent
326b2f96ae
commit
6a19c6dccf
1 changed files with 2 additions and 2 deletions
|
|
@ -2966,7 +2966,7 @@ public abstract class AbstractJdbc1DatabaseMetaData
|
|||
*/
|
||||
|
||||
if (connection.haveMinimumServerVersion("7.3")) {
|
||||
select = "SELECT n1.nspname as pnspname,n2.nspname as fnspname, ";
|
||||
select = "SELECT DISTINCT n1.nspname as pnspname,n2.nspname as fnspname, ";
|
||||
from = " FROM pg_catalog.pg_namespace n1 "+
|
||||
" JOIN pg_catalog.pg_class c1 ON (c1.relnamespace = n1.oid) "+
|
||||
" JOIN pg_catalog.pg_index i ON (c1.oid=i.indrelid) "+
|
||||
|
|
@ -2985,7 +2985,7 @@ public abstract class AbstractJdbc1DatabaseMetaData
|
|||
where += " AND n2.nspname = '"+escapeQuotes(foreignSchema)+"' ";
|
||||
}
|
||||
} else {
|
||||
select = "SELECT NULL::text as pnspname, NULL::text as fnspname, ";
|
||||
select = "SELECT DISTINCT NULL::text as pnspname, NULL::text as fnspname, ";
|
||||
from = " FROM pg_class c1 "+
|
||||
" JOIN pg_index i ON (c1.oid=i.indrelid) "+
|
||||
" JOIN pg_class ic ON (i.indexrelid=ic.oid) "+
|
||||
|
|
|
|||
Loading…
Reference in a new issue