Re: WIP: Allow SQL-language functions to reference parameters by parameter name - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: WIP: Allow SQL-language functions to reference parameters by parameter name
Date
Msg-id DBAEDF2B-A3E9-45A3-BD0C-5E94F0982B05@nasby.net
Whole thread Raw
In response to Re: WIP: Allow SQL-language functions to reference parameters by parameter name  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Apr 14, 2011, at 4:20 PM, Kevin Grittner wrote:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>
>>> So far the most promising proposal I've seen seems to be to let
>>> id mean the parameter called id only when it can't refer to
>>> anything in the query.
>
>> Yeah, I've come round to that position too.  I think allowing
>> parameter names to be checked only after query names is probably
>> the best answer.
>
> +1
>
> That seems the most useful and least surprising approach to me.

As part of this, can we also allow specifying an alias for the function name? That would make it far less onerous to
disambiguateparameters. Unfortunately we obviously couldn't use AS as the keyword for this alias; maybe we could use
ALIASinstead? IE: 

CREATE FUNCTION function_with_really_really_descriptive_name (some_parameter int
) RETURNS int LANGUAGE SQL ALIAS fwrrdn AS $$SELECT fwrrdn.some_parameter
$$;
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Typed table DDL loose ends
Next
From: Jim Nasby
Date:
Subject: Re: Proposal for GSoC : ADJ dashboard (Administration related software)