Re: function_name.parameter_name

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Darren Duncan <darren(at)darrenduncan(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: function_name.parameter_name
Date: 2010-09-08 21:09:22
Message-ID: D8A5AADE-3D2D-4479-AB8F-FF6C7EDD0B02@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sep 8, 2010, at 3:17 PM, Darren Duncan <darren(at)darrenduncan(dot)net> wrote:
> Bruce Momjian wrote:
>> Sergey Konoplev wrote:
>>> 1.
>>> CREATE FUNCTION func_name(arg_name text) RETURNS integer AS $$
>>> BEGIN
>>> RAISE INFO '%', func_name.arg_name;
>>> ...
>>>
>>> 2.
>>> CREATE FUNCTION func_name() RETURNS integer AS $$
>>> DECLARE
>>> var_name text := 'bla';
>>> BEGIN
>>> RAISE INFO '%', func_name.var_name;
>>> ...
>>>
>>> 3.
>>> CREATE FUNCTION func_very_very_very_very_long_name() RETURNS integer AS $$
>>> << func_alias >>
>>> DECLARE
>>> var_name text := 'bla';
>>> BEGIN
>>> RAISE INFO '%', func_alias.var_name;
>>> ...
>
> I suggest that it might be reasonable to introduce a new syntax, that isn't already valid for something inside a routine, and use that as a terse way to reference the current function and/or its parameters. This may best be a simple constant syntax.

This has been proposed in the past and Tom has rejected it, but I agree that it would be useful. The key word in this proposal is "terse".

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Darren Duncan 2010-09-08 21:41:40 Re: function_name.parameter_name
Previous Message Tom Lane 2010-09-08 21:04:14 Postgres 9.0.0 release scheduled