mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
From: Peter T Mount <patches@maidast.demon.co.uk>
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()
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user