Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit863c9d1

Browse files
committed
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 foundout the following bug: if database has views then getTables() gets the nullpointer exception ('order by relname' makes the listing tree inDbVisualizer a lot useful !!)This patch should propably be applied to the the jdbc1'sDatabaseMetaData.java, too.Panu Outinen
1 parent01cc344 commit863c9d1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,14 +1697,17 @@ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String
16971697
case'S':
16981698
relKind ="SEQUENCE";
16991699
break;
1700+
case'v':
1701+
relKind ="VIEW";
1702+
break;
17001703
default:
17011704
relKind =null;
17021705
}
17031706

17041707
tuple[0] =null;// Catalog name
17051708
tuple[1] =null;// Schema name
17061709
tuple[2] =r.getBytes(1);// Table name
1707-
tuple[3] =relKind.getBytes();// Table type
1710+
tuple[3] =(relKind==null) ?null :relKind.getBytes();// Table type
17081711
tuple[4] =remarks;// Remarks
17091712
v.addElement(tuple);
17101713
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,14 +1697,17 @@ public java.sql.ResultSet getTables(String catalog, String schemaPattern, String
16971697
case'S':
16981698
relKind ="SEQUENCE";
16991699
break;
1700+
case'v':
1701+
relKind ="VIEW";
1702+
break;
17001703
default:
17011704
relKind =null;
17021705
}
17031706

17041707
tuple[0] =null;// Catalog name
17051708
tuple[1] =null;// Schema name
17061709
tuple[2] =r.getBytes(1);// Table name
1707-
tuple[3] =relKind.getBytes();// Table type
1710+
tuple[3] =(relKind==null) ?null :relKind.getBytes();// Table type
17081711
tuple[4] =remarks;// Remarks
17091712
v.addElement(tuple);
17101713
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp