Re: Calling functions with table-based-type parametars - Mailing list pgsql-jdbc

From Mario Splivalo
Subject Re: Calling functions with table-based-type parametars
Date
Msg-id 1172579058.11691.17.camel@localhost.localdomain
Whole thread Raw
In response to Re: Calling functions with table-based-type parametars  (Kris Jurka <jurka@ejurka.com>)
Responses Re: Calling functions with table-based-type parametars
List pgsql-jdbc
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] <jura> 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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Minor performance improvements
Next
From: Mario Splivalo
Date:
Subject: Re: Calling functions with table-based-type parametars