Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 6CE849FB672 for ; Tue, 27 Feb 2007 08:24:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 72826-08 for ; Tue, 27 Feb 2007 08:24:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by postgresql.org (Postfix) with ESMTP id 98E349FB36E for ; Tue, 27 Feb 2007 08:24:28 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id AC74A186CC; Tue, 27 Feb 2007 13:24:25 +0100 (CET) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14420-01-8; Tue, 27 Feb 2007 13:24:19 +0100 (CET) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 25B4417F55; Tue, 27 Feb 2007 13:24:18 +0100 (CET) Subject: Re: Calling functions with table-based-type parametars From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: Kris Jurka Cc: pgsql-jdbc@postgresql.org In-Reply-To: <45E31E8E.9070305@ejurka.com> References: <1172246374.23787.25.camel@localhost.localdomain> <1172506356.8206.27.camel@localhost.localdomain> <1172510852.974.2.camel@localhost.localdomain> <45E31E8E.9070305@ejurka.com> Content-Type: text/plain Organization: Mob-Art d.o.o. Date: Tue, 27 Feb 2007 13:24:18 +0100 Message-Id: <1172579058.11691.17.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/147 X-Sequence-Number: 16703 On Mon, 2007-02-26 at 10:53 -0700, Kris Jurka wrote: > Mario Splivalo wrote: > >> This is saying you need to write it with a cast from the row to the table > >> type: > >> > >> conn.prepareCall("{call f1(ROW(?, ?)::t1)}") > > > > Can't do that either. Postgres tells me that there is no type t1: > > > > 2007-02-26 18:25:19.004 CET [10324] PARSEERROR: type "t1" does > > not exist > > > > I even tried creating type _t1 wich has same member variables as table > > rows, and created function f2 wich takes _t1 as parametar, still same > > error: type "_t1" does not exsit. > > > > The attached test case works fine for me without a cast. Perhaps you > can modify this to show the failure you're getting. > As it turns out, it was permissions problem. I created the table and the function as the database owner. But, there is user set up for tomcat/jdbc, and all data manipulation is done trough psql functions. Now, that user has GRANT EXECUTE ON f1(t1) TO jdbcuser; Still, when I try to SELECT f1 from psql, connected as uset jdbcuser, I get the ERROR: function f1(record) does not exist. If I try it with dbowner user, everything works fine. Now I don't know how to set up permisions, but that's for another mailing list. Thank you for your effort, Kris. Mario