Re: createArrayOf, type resolved outside search_path on arrays of composite

From: Kris Jurka <books(at)ejurka(dot)com>
To: Jean-Pierre Pelletier <jppelletier(at)e-djuster(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: createArrayOf, type resolved outside search_path on arrays of composite
Date: 2008-09-09 23:24:04
Message-ID: Pine.BSO.4.64.0809091919380.30865@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Krishnan Trikkadeeri 2008-09-10 17:45:57 looking for a jdbc method.
Previous Message Jean-Pierre Pelletier 2008-09-09 22:44:32 createArrayOf, type resolved outside search_path on arrays of composite