Re: Proposal: OUT parameters for plpgsql - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Proposal: OUT parameters for plpgsql
Date
Msg-id 20050321213006.GR51784@decibel.org
Whole thread Raw
In response to Proposal: OUT parameters for plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 21, 2005 at 02:25:47PM -0500, Tom Lane wrote:
> A possible future extension is to add some sort of direct procedure call
> syntax in plpgsql.  Right now, you'd need to write something like
>     select into x,y,z from foo(a,b,c);
> to call a function with IN parameters a,b,c and get back OUT parameters
> x,y,z.  It would obviously be nicer to write
>     foo(a,b,c,x,y,z);
> However, I'm inclined to wait on this until someone does
> parameter-matching-by-name, for fear of creating problems for that
> feature.  (If people think this couldn't interfere, maybe I'll go ahead
> and do it.)  I'm not planning to invent new calling syntax at the SQL
> level, either, since that's probably best reserved for procedures-outside-
> transactions.

ISTM that we'd want to support calling by position as well as calling by
parameter name, which means there will need to be a different calling
convention for the two modes. foo(a, b, c) is the only logical way to
call by position, and I don't see how it could interfer with calling by
name, which would need to be something like foo(param_a=>a, param_b=>b,
param_c=>c). In the meantime, I think being able to call foo(a, b, c)
is much nicer than SELECT INTO b, c foo(a, b). Not only is it more
compact and readable, it will make porting to plpgsql easier.
-- 
Jim C. Nasby, Database Consultant               decibel@decibel.org 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Proposal: OUT parameters for plpgsql
Next
From: Simon Riggs
Date:
Subject: Re: Avoiding unnecessary writes during relation drop and