[libpostgresql-jdbc-java] 13/19: patch for returning database metadata as system objects from Kris Jurka
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to tag REL7_4_1
in repository libpostgresql-jdbc-java.
commit b3b40658d9ca392095e5f725331bc9d92ac34aac
Author: Dave Cramer <davec at fastcrypt.com>
Date: Sat Dec 13 00:59:19 2003 +0000
patch for returning database metadata as system objects from Kris Jurka
---
.../jdbc1/AbstractJdbc1DatabaseMetaData.java | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java b/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
index 25b7083..1a0d978 100644
--- a/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
+++ b/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
@@ -1971,15 +1971,15 @@ public abstract class AbstractJdbc1DatabaseMetaData
if (connection.haveMinimumServerVersion("7.3")) {
useSchemas = "SCHEMAS";
select = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME, "+
- " CASE n.nspname LIKE 'pg\\\\_%' "+
- " WHEN true THEN CASE n.nspname "+
- " WHEN 'pg_catalog' THEN CASE c.relkind "+
+ " CASE n.nspname LIKE 'pg\\\\_%' OR n.nspname = 'information_schema' "+
+ " WHEN true THEN CASE "+
+ " WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind "+
" WHEN 'r' THEN 'SYSTEM TABLE' "+
" WHEN 'v' THEN 'SYSTEM VIEW' "+
" WHEN 'i' THEN 'SYSTEM INDEX' "+
" ELSE NULL "+
" END "+
- " WHEN 'pg_toast' THEN CASE c.relkind "+
+ " WHEN n.nspname = 'pg_toast' THEN CASE c.relkind "+
" WHEN 'r' THEN 'SYSTEM TOAST TABLE' "+
" WHEN 'i' THEN 'SYSTEM TOAST INDEX' "+
" ELSE NULL "+
@@ -2089,15 +2089,15 @@ public abstract class AbstractJdbc1DatabaseMetaData
tableTypeClauses = new Hashtable();
Hashtable ht = new Hashtable();
tableTypeClauses.put("TABLE",ht);
- ht.put("SCHEMAS","c.relkind = 'r' AND n.nspname NOT LIKE 'pg\\\\_%'");
+ ht.put("SCHEMAS","c.relkind = 'r' AND n.nspname NOT LIKE 'pg\\\\_%' AND n.nspname <> 'information_schema'");
ht.put("NOSCHEMAS","c.relkind = 'r' AND c.relname NOT LIKE 'pg\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("VIEW",ht);
- ht.put("SCHEMAS","c.relkind = 'v' AND n.nspname <> 'pg_catalog'");
+ ht.put("SCHEMAS","c.relkind = 'v' AND n.nspname <> 'pg_catalog' AND n.nspname <> 'information_schema'");
ht.put("NOSCHEMAS","c.relkind = 'v' AND c.relname NOT LIKE 'pg\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("INDEX",ht);
- ht.put("SCHEMAS","c.relkind = 'i' AND n.nspname NOT LIKE 'pg\\\\_%'");
+ ht.put("SCHEMAS","c.relkind = 'i' AND n.nspname NOT LIKE 'pg\\\\_%' AND n.nspname <> 'information_schema'");
ht.put("NOSCHEMAS","c.relkind = 'i' AND c.relname NOT LIKE 'pg\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("SEQUENCE",ht);
@@ -2105,7 +2105,7 @@ public abstract class AbstractJdbc1DatabaseMetaData
ht.put("NOSCHEMAS","c.relkind = 'S'");
ht = new Hashtable();
tableTypeClauses.put("SYSTEM TABLE",ht);
- ht.put("SCHEMAS","c.relkind = 'r' AND n.nspname = 'pg_catalog'");
+ ht.put("SCHEMAS","c.relkind = 'r' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema')");
ht.put("NOSCHEMAS","c.relkind = 'r' AND c.relname LIKE 'pg\\\\_%' AND c.relname NOT LIKE 'pg\\\\_toast\\\\_%' AND c.relname NOT LIKE 'pg\\\\_temp\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("SYSTEM TOAST TABLE",ht);
@@ -2117,11 +2117,11 @@ public abstract class AbstractJdbc1DatabaseMetaData
ht.put("NOSCHEMAS","c.relkind = 'i' AND c.relname LIKE 'pg\\\\_toast\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("SYSTEM VIEW",ht);
- ht.put("SCHEMAS","c.relkind = 'v' AND n.nspname = 'pg_catalog' ");
+ ht.put("SCHEMAS","c.relkind = 'v' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema') ");
ht.put("NOSCHEMAS","c.relkind = 'v' AND c.relname LIKE 'pg\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("SYSTEM INDEX",ht);
- ht.put("SCHEMAS","c.relkind = 'i' AND n.nspname = 'pg_catalog'");
+ ht.put("SCHEMAS","c.relkind = 'i' AND (n.nspname = 'pg_catalog' OR n.nspname = 'information_schema') ");
ht.put("NOSCHEMAS","c.relkind = 'v' AND c.relname LIKE 'pg\\\\_%' AND c.relname NOT LIKE 'pg\\\\_toast\\\\_%' AND c.relname NOT LIKE 'pg\\\\_temp\\\\_%'");
ht = new Hashtable();
tableTypeClauses.put("TEMPORARY TABLE",ht);
--
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