Re: createArrayOf, type resolved outside search_path on arrays of composite - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: createArrayOf, type resolved outside search_path on arrays of composite
Date
Msg-id Pine.BSO.4.64.0809091919380.30865@leary.csoft.net
Whole thread Raw
In response to createArrayOf, type resolved outside search_path on arrays of composite  ("Jean-Pierre Pelletier" <jppelletier@e-djuster.com>)
List pgsql-jdbc

On Tue, 9 Sep 2008, Jean-Pierre Pelletier wrote:

> I've got a composite type testtype and a function
> testfunction(testtype[]) of the same name in two schemas. The function
> is called with callableStatement and the parameter set with
> createArrayOf() of jdbc 4. The error received when calling the function:
> ERROR: function testfunction(testschema1.testtype[]) does not exist
> suggests that the unqualified type is resolved to a type from a schema
> not in the search_path.

The problem is actually that the type cache is not schema aware.  So it
first resolves the name to an OID in testschema1 and when you call it
again with the same name, the driver doesn't bother checking the
search path or the database and simply uses the OID it resolved
previously.  I don't know of any workaround for this other than using type
names that are unique across schemas.

Kris Jurka

pgsql-jdbc by date:

Previous
From: "Jean-Pierre Pelletier"
Date:
Subject: createArrayOf, type resolved outside search_path on arrays of composite
Next
From: "Krishnan Trikkadeeri"
Date:
Subject: looking for a jdbc method.