1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-29 13:56:47 +03: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:
Dave Cramer 2003-03-25 02:28:45 +00:00
parent 326b2f96ae
commit 6a19c6dccf

View File

@ -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) "+