pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ezequiel Tolnay <mail@etolnay.com.ar>
To: pgsql-admin@postgresql.org
Subject: Re: functions vs stored procedures
Date: Fri, 15 Jul 2005 10:57:04 +1000
Message-ID: <db71hd$1eqd$1@news.hub.org> (raw)
In-Reply-To: <14063.1121347025@sss.pgh.pa.us>
References: <daj141$25ks$1@news.hub.org>
	<14063.1121347025@sss.pgh.pa.us>

Thanks for the tip, but unfortunately id didn't address any of my 
concerns. I alreay use the version 8, and I'm aware of the possibility 
of using arrays for the results, which allows for some flexibility. But 
unfortunately arrays are not records, and I'm limited to values of the 
same types, and cannot refer the values from their column names. To 
create this function I also have to build the arrays for each result, 
casting all the values to text in a way that I would be able to convert 
back to the original value.

As it is, the workaround is more complicated than the problem itself, so 
I think a script droping and recreating all the types and the functions 
that use them is preferred.

¿Does anyone know if there is a reason why PostgreSQL lacks stored 
procedures? i.e. the type that is executed with the EXECUTE command 
(e.g. EXECUTE myproc(1, 2, 3)) and capable of returning an arbitrary 
number of rowsets of arbitrary types.

Thanks anyway :o)

Ezequiel Tolnay

Tom Lane wrote:
> Ezequiel Tolnay <mail@etolnay.com.ar> writes:
> 
>>I just can't get used to the annoyance of having to create a type for 
>>every single function that returns a rowset. It is frankly cumbersome.
> 
> 
> Yup.  See coming attractions at, eg,
> http://developer.postgresql.org/docs/postgres/xfunc-sql.html#XFUNC-OUTPUT-PARAMETERS
> http://developer.postgresql.org/docs/postgres/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIASES
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
> 



view thread (5+ messages)  latest in thread

Message-ID: <db71hd$1eqd$1@news.hub.org>
Permalink:  ../db71hd$1eqd$1@news.hub.org/
Also on:    postgresql.org/message-id/db71hd$1eqd$1@news.hub.org

 · 

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-admin@postgresql.org
  Cc: mail@etolnay.com.ar
  Subject: Re: functions vs stored procedures
  In-Reply-To: <db71hd$1eqd$1@news.hub.org>
  References: <daj141$25ks$1@news.hub.org> <14063.1121347025@sss.pgh.pa.us> <db71hd$1eqd$1@news.hub.org>

* 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