diff options
Diffstat (limited to 'src/interfaces/jdbc/postgresql/DatabaseMetaData.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/DatabaseMetaData.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java index 47c257e7824..d717218c8f8 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. |