Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7aa6270

Browse files
author
Dave Cramer
committed
patch from Mitchel Friedman to fix getTables
1 parent 925d60e commit 7aa6270

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/*
1414
* This class provides information about the database as a whole.
1515
*
16-
* $Id: DatabaseMetaData.java,v 1.43 2002/03/05 02:14:06 davec Exp $
16+
* $Id: DatabaseMetaData.java,v 1.44 2002/03/05 03:02:47 davec Exp $
1717
*
1818
* <p>Many of the methods here return lists of information in ResultSets. You
1919
* can use the normal ResultSet methods such as getString and getInt to
@@ -1731,9 +1731,16 @@ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String
17311731
String relKind;
17321732
switch (r.getBytes(3)[0])
17331733
{
1734-
case (byte) 'r':
1735-
relKind = "TABLE";
1736-
break;
1734+
case (byte) 'r':
1735+
if ( r.getString(1).startsWith("pg_") )
1736+
{
1737+
relKind = "SYSTEM TABLE";
1738+
}
1739+
else
1740+
{
1741+
relKind = "TABLE";
1742+
}
1743+
break;
17371744
case (byte) 'i':
17381745
relKind = "INDEX";
17391746
break;

src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/*
1616
* This class provides information about the database as a whole.
1717
*
18-
* $Id: DatabaseMetaData.java,v 1.50 2002/03/05 02:14:08 davec Exp $
18+
* $Id: DatabaseMetaData.java,v 1.51 2002/03/05 03:02:52 davec Exp $
1919
*
2020
* <p>Many of the methods here return lists of information in ResultSets. You
2121
* can use the normal ResultSet methods such as getString and getInt to
@@ -1832,7 +1832,14 @@ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String
18321832
switch (r.getBytes(3)[0])
18331833
{
18341834
case (byte) 'r':
1835-
relKind = "TABLE";
1835+
if ( r.getString(1).startsWith("pg_") )
1836+
{
1837+
relKind = "SYSTEM TABLE";
1838+
}
1839+
else
1840+
{
1841+
relKind = "TABLE";
1842+
}
18361843
break;
18371844
case (byte) 'i':
18381845
relKind = "INDEX";

0 commit comments

Comments
 (0)