Commit 863c9d11 authored by Bruce Momjian's avatar Bruce Momjian

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
parent 01cc3440
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment