Commit 6a19c6dc authored by Dave Cramer's avatar Dave Cramer

added DISTINCT to the query to get cross reference. This is required when two...

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
parent 326b2f96
......@@ -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) "+
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment