[libpostgresql-jdbc-java] 16/22: 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 at pace2020.com

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL7_3_4
in repository libpostgresql-jdbc-java.

commit 7c341e7ca0fc26c80a6d628ffb8027665f7c8395
Author: Dave Cramer <davec at fastcrypt.com>
Date:   Tue Mar 25 02:01:19 2003 +0000

    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 at pace2020.com
---
 org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java b/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
index a80b327..305b88e 100644
--- a/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
+++ b/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
@@ -2960,7 +2960,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) "+
@@ -2979,7 +2979,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) "+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list