Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B4F3763F955 for ; Thu, 11 Mar 2010 19:30:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01172-02-4 for ; Thu, 11 Mar 2010 23:30:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f187.google.com (mail-iw0-f187.google.com [209.85.223.187]) by mail.postgresql.org (Postfix) with ESMTP id 268F363FE26 for ; Thu, 11 Mar 2010 18:39:45 -0400 (AST) Received: by iwn17 with SMTP id 17so585508iwn.19 for ; Thu, 11 Mar 2010 14:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=UBcFJ9GqrJJM1LYG+jY4QFvCtRXPVlTcuubx/yXIt4k=; b=LqKVlKgzUqyp4cVAN18py/kULRJ0hf0MvHCdmHA/7R9JxborGzVp+/IZoG5OMj43Pt kpBdU0KGNUO7U5VsdizgD67n0Mq+VCL2HkhBVE2XxMCYwDmyFdDkRd4kt/coqRSwhvTL CpVEzzqgMqzdYWx3jNfZ4+WhxW6wjiyIITYWs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ava755zUDS5nNcjZ9p1gZ9dsxzHpmnuqyqMe0MRFpMa2WkvdAwNYQFfHdxFgF4GPHK vH6Wmn9f/qHUHZBUPWBYBD0UKh0MowDzumz/9RiYNiqkgScbggiekLwYfbx535tM9rSa Rz3Mkzk6yzaLBVSc4z4B/GB7Qc56L3Ty/4v5k= MIME-Version: 1.0 Received: by 10.231.161.143 with SMTP id r15mr542136ibx.62.1268347183307; Thu, 11 Mar 2010 14:39:43 -0800 (PST) In-Reply-To: <98bbb46a1003101820h2ef41b09w45ce304fa8c01469@mail.gmail.com> References: <98bbb46a1003101807m475f3812gac5b381685d6498a@mail.gmail.com> <98bbb46a1003101820h2ef41b09w45ce304fa8c01469@mail.gmail.com> Date: Thu, 11 Mar 2010 17:39:43 -0500 Message-ID: <98bbb46a1003111439y5a83f3fdqf7089a37091adf11@mail.gmail.com> Subject: Re: Multiple Functions and Tables in different Schemas with COmposite Types From: Jason Tesser To: pgsql-jdbc Content-Type: multipart/alternative; boundary=001636c5c075501b7d04818e1739 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/46 X-Sequence-Number: 20386 --001636c5c075501b7d04818e1739 Content-Type: text/plain; charset=ISO-8859-1 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 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 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. >> >> > --001636c5c075501b7d04818e1739 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Any ideas here?=A0 I am pretty sure this is a bug.

It is easy to re= produce.

1. Create 2 schemas with tables of the same name
2. Cre= ate 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

Wh= en it tries to set the parameter on the Prepared Statement one schema will = work and the other will not.=A0


--001636c5c075501b7d04818e1739--