Re: Issues for named/mixed function notation patch - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Issues for named/mixed function notation patch
Date
Msg-id 407d949e0908091956g18d5e9a1k4218b02d7768e3a6@mail.gmail.com
Whole thread Raw
In response to Re: Issues for named/mixed function notation patch  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Aug 10, 2009 at 2:23 AM, Robert Haas<robertmhaas@gmail.com> wrote:
>
>> 2. It doesn't appear that any attention has been given to what happens
>> if CREATE OR REPLACE FUNCTION is used to change the parameter names of
>> an existing function.  Since the post-analysis representation of parameter
>> lists is still entirely positional, the actual effect on a function call
>> in a stored view or rule is nil --- it will still call the same function
>> it did before, passing the parameters that were originally identified to
>> be passed.  That might be considered good, but it's quite unlike what
>> will happen to function calls that are stored textually (eg, in plpgsql
>> functions).  Is that what we want?
>
> That sounds pretty dangerous.  What if someone renames a parameter so
> as to invert its sense, or something?  (automatically_delete_all_files
> becomes confirm_before_deleting, or somesuch)

There's also the existing users using positional notation to consider.
If all my callers are using positional notation then I might be kind
of annoyed if I can't fix the parameter names of my functions because
it would change the function signature. That would be a functionality
regression for me.

But on balance I don't see a better solution. If we allow people to
change the parameter names and they're used for named arguments then
it seems like the behaviour is not very clear and predictable no
matter what resolution we pick.



--
greg
http://mit.edu/~gsstark/resume.pdf


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] 2PC state files on shared memory
Next
From: Brendan Jurd
Date:
Subject: Re: WIP: to_char, support for EEEE format