Re: Anonymous code blocks - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Anonymous code blocks
Date
Msg-id 14669.1253412760@sss.pgh.pa.us
Whole thread Raw
In response to Re: Anonymous code blocks  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Anonymous code blocks
Re: Anonymous code blocks
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Dimitri Fontaine wrote:
>> So here are the major points about this patch:
>> - it's missing the returns declaration syntax (default value could be
>> returns void?)
>> - it would be much more friendly to users if it had a default output
>> for queries, the returned object seems a good fit

> Really? That wasn't my expectation at all. I expected that the code 
> would in effect be always returning void. I think you're moving the 
> goalposts a bit here. I don't think we need a RETURNS clause on it for 
> it to be useful.

Yeah.  The presented examples aren't tremendously convincing, as they
both beg the question "why not just do a SELECT?".  It's also not
exactly apparent to me why redefining the behavior of SELECT in a
plpgsql function would be a better thing than having RETURN do it.

I think adding onto DO capabilities is something we could do later
if demand warrants.  I'd prefer to underdesign it for starters than
to encrust it with features that might not be needed.

BTW, what happens with the current patch if you try to do a RETURN?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: updated hstore patch
Next
From: David Fetter
Date:
Subject: Re: operator exclusion constraints [was: generalized index constraints]