mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
I was trying to get a very nice FREE graphical db tool called DbVisualizer
(http://www.ideit.com/products/dbvis/) to work with Postgresql and I found out the following bug: if database has views then getTables() gets the null pointer exception ('order by relname' makes the listing tree in DbVisualizer a lot useful !!) This patch should propably be applied to the the jdbc1's DatabaseMetaData.java, too. Panu Outinen
This commit is contained in:
parent
01cc344011
commit
863c9d11f1
@ -1697,6 +1697,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
|
||||
case 'S':
|
||||
relKind = "SEQUENCE";
|
||||
break;
|
||||
case 'v':
|
||||
relKind = "VIEW";
|
||||
break;
|
||||
default:
|
||||
relKind = null;
|
||||
}
|
||||
@ -1704,7 +1707,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
|
||||
tuple[0] = null; // Catalog name
|
||||
tuple[1] = null; // Schema name
|
||||
tuple[2] = r.getBytes(1); // Table name
|
||||
tuple[3] = relKind.getBytes(); // Table type
|
||||
tuple[3] = (relKind==null) ? null : relKind.getBytes(); // Table type
|
||||
tuple[4] = remarks; // Remarks
|
||||
v.addElement(tuple);
|
||||
}
|
||||
|
@ -1697,6 +1697,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
|
||||
case 'S':
|
||||
relKind = "SEQUENCE";
|
||||
break;
|
||||
case 'v':
|
||||
relKind = "VIEW";
|
||||
break;
|
||||
default:
|
||||
relKind = null;
|
||||
}
|
||||
@ -1704,7 +1707,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
|
||||
tuple[0] = null; // Catalog name
|
||||
tuple[1] = null; // Schema name
|
||||
tuple[2] = r.getBytes(1); // Table name
|
||||
tuple[3] = relKind.getBytes(); // Table type
|
||||
tuple[3] = (relKind==null) ? null : relKind.getBytes(); // Table type
|
||||
tuple[4] = remarks; // Remarks
|
||||
v.addElement(tuple);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user