Index: org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java,v retrieving revision 1.13 diff -u -r1.13 AbstractJdbc1DatabaseMetaData.java --- org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java 2002/12/11 21:02:58 1.13 +++ org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java 2002/12/17 16:34:20 @@ -2903,9 +2903,11 @@ " ci.relname AS PK_NAME "+ from+ " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid "+ - " AND a.attrelid=ci.oid AND i.indisprimary "+ - " AND ct.relname = '"+escapeQuotes(table)+"' "+ - where+ + " AND a.attrelid=ci.oid AND i.indisprimary "; + if (table != null && !"".equals(table)) { + sql += " AND ct.relname = '"+escapeQuotes(table)+"' "; + } + sql += where+ " ORDER BY table_name, pk_name, key_seq"; return connection.createStatement().executeQuery(sql); }