Skip site navigation (1) Skip section navigation (2)

Re: Calling functions with table-based-type parametars

From: Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr>
To: Kris Jurka <jurka(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Calling functions with table-based-type parametars
Date: 2007-02-27 12:24:18
Message-ID: 1172579058.11691.17.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: 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


In response to

Responses

pgsql-jdbc by date

Next:From: Mario SplivaloDate: 2007-02-27 12:37:03
Subject: Re: Calling functions with table-based-type parametars
Previous:From: Stephen DenneDate: 2007-02-27 10:46:33
Subject: Re: Minor performance improvements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group