]> granicus.if.org Git - postgresql/commitdiff
Fix pg_index statistics query to join proper relation.
authorBruce Momjian <bruce@momjian.us>
Thu, 17 May 2001 11:54:04 +0000 (11:54 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 17 May 2001 11:54:04 +0000 (11:54 +0000)
src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

index 02f6b06a276879dc02c26b0e52324208d8aea721..e3f36cae00db9b7e949b623bd3d57d411eb3a2fc 100644 (file)
@@ -2658,7 +2658,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
                                "WHERE ((c.relname = '" + tableName.toLowerCase() + "') " +
                                " AND (c.oid = x.indrelid) " +
                                " AND (i.oid = x.indexrelid) " +
-                               " AND (c.relam = a.oid)) " +
+                               " AND (i.relam = a.oid)) " +
                                "ORDER BY x.indisunique DESC, " +
                                " x.indisclustered, a.amname, i.relname");  
     while (r.next()) {
index a17e9e1d84a93942e5b28bb0e63d0fd45f472c91..749c2ba83cdfa2e5696eafa071bfd6d9a1937e1f 100644 (file)
@@ -2656,7 +2656,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
                                "WHERE ((c.relname = '" + tableName.toLowerCase() + "') " +
                                " AND (c.oid = x.indrelid) " +
                                " AND (i.oid = x.indexrelid) " +
-                               " AND (c.relam = a.oid)) " +
+                               " AND (i.relam = a.oid)) " +
                                "ORDER BY x.indisunique DESC, " +
                                " x.indisclustered, a.amname, i.relname");  
     while (r.next()) {