Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

type cache info fix

6 views
Skip to first unread message

Gary Baker

unread,
Mar 29, 2013, 1:08:04 PM3/29/13
to
I found that type cache info wasn't honoring search path. (I had a
UDT type that shared a name with a table).

This fixed it.


diff --git a/org/postgresql/jdbc2/TypeInfoCache.java
b/org/postgresql/jdbc2/TypeInfoCache.java
index 2e79758..2d26fd0 100644
--- a/org/postgresql/jdbc2/TypeInfoCache.java
+++ b/org/postgresql/jdbc2/TypeInfoCache.java
@@ -234,7 +234,7 @@ public class TypeInfoCache implements TypeInfo {
if (_getOidStatement == null) {
String sql;
if (_conn.haveMinimumServerVersion("7.3")) {
- sql = "SELECT oid FROM pg_catalog.pg_type WHERE typname = ?";
+ sql = "SELECT ?::regtype::oid";
} else {
sql = "SELECT oid FROM pg_type WHERE typname = ?";
}


--
Sent via pgsql-jdbc mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

0 new messages