Re: named parameters in SQL functions

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: named parameters in SQL functions
Date: 2009-11-16 02:18:16
Message-ID: 4B00B668.4080709@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Chernow <ac(at)esilo(dot)com> writes:
>> Tom Lane wrote:
>>> (But having said that, an alternate qualification name is something
>>> that could be implemented if there were any agreement on what to use.)
>
>> Would something like ARG.name be acceptable?
>
> It all depends on how likely you think it is that the function would use
> a table name or alias matching ARG (or any other proposal).
>
> It's certainly true that the function name itself is not immune from
> conflicts of that sort ... in fact I think we saw a bug report recently
> from someone who had intentionally chosen a plpgsql function name equal
> to a table name used in the function :-(. So I'm not wedded to the
> function name entirely. But it has precedent in plpgsql, and that
> precedent came from Oracle, so I don't think we should lightly make SQL
> functions do something different.
>

If the concern is portability, (ANYTHING).name won't work. You would have to
stick with function.name or support both styles.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2009-11-16 02:29:28 Re: Aggregate ORDER BY patch
Previous Message Tom Lane 2009-11-16 02:09:32 Re: named parameters in SQL functions