Re: Multiple Functions and Tables in different Schemas with COmposite Types

From: Jason Tesser <jasontesser(at)gmail(dot)com>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Multiple Functions and Tables in different Schemas with COmposite Types
Date: 2010-03-11 22:39:43
Message-ID: 98bbb46a1003111439y5a83f3fdqf7089a37091adf11@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Any ideas here? I am pretty sure this is a bug.

It is easy to reproduce.

1. Create 2 schemas with tables of the same name
2. Create the same function in each schema each taking as an IN param the
table
3. From Java use a Stored proc to call the function setting the search_path
accordingly.
4. Use a prepared statement to set the IN param

When it tries to set the parameter on the Prepared Statement one schema will
work and the other will not.

On Wed, Mar 10, 2010 at 9:20 PM, Jason Tesser <jasontesser(at)gmail(dot)com> wrote:

> I guess my issues here is that the driver doesn't seem to provide me a way
> of handling tablenamespace when types of the same name live in 2 different
> schemas.
>
> Can I control this at all?
>
>
> On Wed, Mar 10, 2010 at 9:07 PM, Jason Tesser <jasontesser(at)gmail(dot)com>wrote:
>
>> I am getting this error function person_save(testclient.person, unknown,
>> testclient.email[], unknown) does not exist when using a prepared
>> statement.
>>
>> the reason for this is SELECT oid FROM pg_catalog.pg_type WHERE typname =
>> $1
>> is called and $1 is person
>> it gets the wrong oid, multiple OID are returned
>>
>> I tried to make my type be schema.person but that doesn't work
>> This IN parameters are composite types so I had to create objects that
>> extended PGObject to make it work
>>
>> My procs all work as I can call from pgadmin by setting searchpath. But
>> from java with a prepared statement and ? as the IN parameters it fails even
>> with the searchpath set.
>>
>>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jason Tesser 2010-03-11 22:42:39 Re: Multiple Functions and Tables in different Schemas with COmposite Types
Previous Message Jasen Betts 2010-03-11 08:49:50 Re: Clarification With Money data type