patch from Mitchel Friedman to fix getTables
authorDave Cramer <davec@fastcrypt.com>
Tue, 5 Mar 2002 03:02:52 +0000 (03:02 +0000)
committerDave Cramer <davec@fastcrypt.com>
Tue, 5 Mar 2002 03:02:52 +0000 (03:02 +0000)
src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

index 11855d3fbd3601eee0d033a6bef7b0bacbd4dc24..38efcb1e3617076a96f29f4341711320ae9d8efe 100644 (file)
@@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException;
 /*
  * This class provides information about the database as a whole.
  *
- * $Id: DatabaseMetaData.java,v 1.43 2002/03/05 02:14:06 davec Exp $
+ * $Id: DatabaseMetaData.java,v 1.44 2002/03/05 03:02:47 davec Exp $
  *
  * <p>Many of the methods here return lists of information in ResultSets.  You
  * can use the normal ResultSet methods such as getString and getInt to
@@ -1731,9 +1731,16 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
            String relKind;
            switch (r.getBytes(3)[0])
            {
-               case (byte) 'r':
-                   relKind = "TABLE";
-                   break;
+               case (byte) 'r':                                        
+                   if ( r.getString(1).startsWith("pg_") )
+                                        {
+                                                relKind = "SYSTEM TABLE";
+                                        }
+                                        else
+                                        {
+                                                relKind = "TABLE";
+                                        }
+                   break;
                case (byte) 'i':
                    relKind = "INDEX";
                    break;
index 8aa18f6cba0205ac7f6e8f3f04a2e099314c6586..15af39a5e0f6dfc3a5cd9a5b3e29e105618da356 100644 (file)
@@ -15,7 +15,7 @@ import org.postgresql.util.PSQLException;
 /*
  * This class provides information about the database as a whole.
  *
- * $Id: DatabaseMetaData.java,v 1.50 2002/03/05 02:14:08 davec Exp $
+ * $Id: DatabaseMetaData.java,v 1.51 2002/03/05 03:02:52 davec Exp $
  *
  * <p>Many of the methods here return lists of information in ResultSets.  You
  * can use the normal ResultSet methods such as getString and getInt to
@@ -1832,7 +1832,14 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
            switch (r.getBytes(3)[0])
            {
                case (byte) 'r':
-                   relKind = "TABLE";
+                   if ( r.getString(1).startsWith("pg_") )
+                   {
+                       relKind = "SYSTEM TABLE";
+                   }
+                   else
+                   {
+                       relKind = "TABLE";
+                   }
                    break;
                case (byte) 'i':
                    relKind = "INDEX";