Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group