summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/DatabaseMetaData.java
diff options
context:
space:
mode:
authorMarc G. Fournier1998-02-09 03:22:41 +0000
committerMarc G. Fournier1998-02-09 03:22:41 +0000
commit2535fcde2a8a56159ed90b0debc05cf3be06ac35 (patch)
treed3fed126048e4002bab9b4a9e605e180913e678a /src/interfaces/jdbc/postgresql/DatabaseMetaData.java
parent83e637a99a3d8adbc0a4979cdf42303bbb8c7bb7 (diff)
From: Peter T Mount <[email protected]>
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()
Diffstat (limited to 'src/interfaces/jdbc/postgresql/DatabaseMetaData.java')
-rw-r--r--src/interfaces/jdbc/postgresql/DatabaseMetaData.java10
1 files changed, 10 insertions, 0 deletions
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.