From 2535fcde2a8a56159ed90b0debc05cf3be06ac35 Mon Sep 17 00:00:00 2001 From: Marc G. Fournier Date: Mon, 9 Feb 1998 03:22:41 +0000 Subject: From: Peter T Mount This patch fixes the following: * Fixes minor bug found in DatabaseMetaData.getTables() where it doesn't handle default table types. * It now reports an error if the client opens a database using properties, and either the user or password properties are missing. This should make the recent problem with Servlets easier to find. * Commented out obsolete property in Driver.getPropertyInfo() --- src/interfaces/jdbc/postgresql/DatabaseMetaData.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/interfaces/jdbc/postgresql/DatabaseMetaData.java') diff --git a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java index 47c257e782..d717218c8f 100644 --- a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java +++ b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java @@ -1615,6 +1615,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData */ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String types[]) throws SQLException { + // Handle default value for types + if(types==null) + types = defaultTableTypes; + // the field descriptors for the new ResultSet Field f[] = new Field[5]; ResultSet r; // ResultSet for the SQL query that we need to do @@ -1687,6 +1691,12 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData {"SYSTEM INDEX", "(relkind='i' and relname ~ '^pg_')"} }; + // These are the default tables, used when NULL is passed to getTables + // The choice of these provide the same behaviour as psql's \d + private static final String defaultTableTypes[] = { + "TABLE","INDEX","SEQUENCE" + }; + /** * Get the schema names available in this database. The results * are ordered by schema name. -- cgit v1.2.3