pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Splivalo <mario.splivalo@mobart.hr>
To: Kris Jurka <jurka@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Calling functions with table-based-type parametars
Date: Tue, 27 Feb 2007 13:24:18 +0100
Message-ID: <1172579058.11691.17.camel@localhost.localdomain> (raw)
In-Reply-To: <45E31E8E.9070305@ejurka.com>
References: <1172246374.23787.25.camel@localhost.localdomain>
	<Pine.BSO.4.64.0702231415300.13688@leary.csoft.net>
	<1172506356.8206.27.camel@localhost.localdomain>
	<Pine.BSO.4.64.0702261150440.21753@leary.csoft.net>
	<1172510852.974.2.camel@localhost.localdomain>
	<45E31E8E.9070305@ejurka.com>

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




view thread (7+ messages)  latest in thread

Message-ID: <1172579058.11691.17.camel@localhost.localdomain>
Permalink:  ../1172579058.11691.17.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1172579058.11691.17.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mario.splivalo@mobart.hr, jurka@ejurka.com
  Subject: Re: Calling functions with table-based-type parametars
  In-Reply-To: <1172579058.11691.17.camel@localhost.localdomain>
  References: <1172246374.23787.25.camel@localhost.localdomain> <Pine.BSO.4.64.0702231415300.13688@leary.csoft.net> <1172506356.8206.27.camel@localhost.localdomain> <Pine.BSO.4.64.0702261150440.21753@leary.csoft.net> <1172510852.974.2.camel@localhost.localdomain> <45E31E8E.9070305@ejurka.com> <1172579058.11691.17.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox