Re: [HACKERS] function_name.parameter_name

2010-09-09 Thread David E. Wheeler
On Sep 8, 2010, at 3:57 PM, Darren Duncan wrote: While I don't agree with the idea of providing extra names that are probably mostly going to increase the confusion of someone trying to understand such a system, I think this use case would be well covered by synonyms. But these would be

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Bruce Momjian
Sergey Konoplev wrote: Hi, On 7 September 2010 20:35, Tom Lane t...@sss.pgh.pa.us wrote: How does $subject differ from what we already do? ?See http://www.postgresql.org/docs/9.0/static/plpgsql-structure.html So will it be possible to do things like this? 1. CREATE FUNCTION

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: ... but if you supply parameters to the function, it does not work: test= CREATE OR REPLACE FUNCTION xxx(aaa INTEGER) RETURNS void AS $$ ERROR: cannot change name of input parameter yyy HINT: Use DROP FUNCTION first. This is failing

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Darren Duncan
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;

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Robert Haas
On Sep 8, 2010, at 3:17 PM, Darren Duncan dar...@darrenduncan.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 $$

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Darren Duncan
Robert Haas wrote: On Sep 8, 2010, at 3:17 PM, Darren Duncan dar...@darrenduncan.net wrote: Bruce Momjian wrote: Sergey Konoplev wrote: 3. CREATE FUNCTION func_very_very_very_very_long_name() RETURNS integer AS $$ func_alias DECLARE var_name text := 'bla'; BEGIN RAISE INFO '%',

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Alvaro Herrera
Excerpts from Darren Duncan's message of mié sep 08 17:41:40 -0400 2010: For example, if it wouldn't conflict with anything, one could use the | symbol (mnemonic is that means alternation in regular expressions) like this: CREATE FUNCTION func_very_very_very_very_long_name|short_name()

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Darren Duncan
Alvaro Herrera wrote: Excerpts from Darren Duncan's message of mié sep 08 17:41:40 -0400 2010: For example, if it wouldn't conflict with anything, one could use the | symbol (mnemonic is that means alternation in regular expressions) like this: CREATE FUNCTION

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Alvaro Herrera
Excerpts from Darren Duncan's message of mié sep 08 18:29:35 -0400 2010: Personally I like the idea of developers not always having to be forced to choose among two equally good names, and making a wrapper function would be overkill for this feature. While I don't agree with the idea of

Re: [HACKERS] function_name.parameter_name

2010-09-08 Thread Darren Duncan
Alvaro Herrera wrote: Excerpts from Darren Duncan's message of mié sep 08 18:29:35 -0400 2010: Personally I like the idea of developers not always having to be forced to choose among two equally good names, and making a wrapper function would be overkill for this feature. While I don't

[HACKERS] function_name.parameter_name

2010-09-07 Thread David E. Wheeler
Howdy, Anyone ever thought to try to add $subject to PL/pgSQL? Someone left a [comment][] on the PGXN blog about how this is a supported syntax for using named parameters on Oracle. The context is to avoid conflicts between variable names and column names by function-qualifyin the former and

Re: [HACKERS] function_name.parameter_name

2010-09-07 Thread Tom Lane
David E. Wheeler david.whee...@pgexperts.com writes: Anyone ever thought to try to add $subject to PL/pgSQL? How does $subject differ from what we already do? See http://www.postgresql.org/docs/9.0/static/plpgsql-structure.html particularly this: Note: There is actually a hidden outer

Re: [HACKERS] function_name.parameter_name

2010-09-07 Thread David E. Wheeler
On Sep 7, 2010, at 9:35 AM, Tom Lane wrote: How does $subject differ from what we already do? See http://www.postgresql.org/docs/9.0/static/plpgsql-structure.html particularly this: Note: There is actually a hidden outer block surrounding the body of any PL/pgSQL function.

Re: [HACKERS] function_name.parameter_name

2010-09-07 Thread Sergey Konoplev
Hi, On 7 September 2010 20:35, Tom Lane t...@sss.pgh.pa.us wrote: How does $subject differ from what we already do?  See http://www.postgresql.org/docs/9.0/static/plpgsql-structure.html So will it be possible to do things like this? 1. CREATE FUNCTION func_name(arg_name text) RETURNS integer

Re: [HACKERS] function_name.parameter_name

2010-09-07 Thread David E. Wheeler
I think so. Try it! David On Sep 7, 2010, at 11:39 AM, Sergey Konoplev wrote: Hi, On 7 September 2010 20:35, Tom Lane t...@sss.pgh.pa.us wrote: How does $subject differ from what we already do? See http://www.postgresql.org/docs/9.0/static/plpgsql-structure.html So will it be possible