Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-19 Thread Asko Oja
I would agree with making it stricter. It would force people to do less stupid things. Our main use case for default parameter will be getting rid of all the old versions of functions with shorter parameter lists by just creating new versions of old functions with additional default parameters. We

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-18 Thread Bruce Momjian
Tom Lane wrote: > So to summarize what I think we agreed to yesterday: > > * CREATE OR REPLACE FUNCTION has to prevent reducing the pronargdefaults > value of an existing function (ie, you can add more defaults but not > remove any). This ensures a function that matched a given call before > will

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-18 Thread Dimitri Fontaine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Le 18 déc. 08 à 00:56, Tom Lane a écrit : "Pavel Stehule" writes: do you remember on request for using "default" keyword in funccall? This should be solution. In view, you don't store select foo(11), but you have to store select foo(11, defau

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Pavel Stehule
2008/12/18 Pavel Stehule : > 2008/12/18 Tom Lane : >> "Pavel Stehule" writes: >>> 2008/12/17 Tom Lane : Experimenting with the revised code, I found a curious case that might be worth worrying about. Consider the example that started all this: >> >>> do you remember on request for using

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Pavel Stehule
2008/12/18 Tom Lane : > "Pavel Stehule" writes: >> 2008/12/17 Tom Lane : >>> Experimenting with the revised code, I found a curious case that might >>> be worth worrying about. Consider the example that started all this: > >> do you remember on request for using "default" keyword in funccall? >>

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Tom Lane
"Pavel Stehule" writes: > 2008/12/17 Tom Lane : >> Experimenting with the revised code, I found a curious case that might >> be worth worrying about. Consider the example that started all this: > do you remember on request for using "default" keyword in funccall? > This should be solution. In vi

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Pavel Stehule
2008/12/17 Tom Lane : > I wrote: >> * Two functions that could match a given call after adding defaults >> are considered ambiguous only if they would add the same number of >> defaults; otherwise we prefer the one with fewer parameters. This >> generalizes the rule that an exact match (no default

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Tom Lane
I wrote: > * Two functions that could match a given call after adding defaults > are considered ambiguous only if they would add the same number of > defaults; otherwise we prefer the one with fewer parameters. This > generalizes the rule that an exact match (no defaults) is preferred > over one t

Re: [HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Pavel Stehule
2008/12/17 Tom Lane : > So to summarize what I think we agreed to yesterday: > > * CREATE OR REPLACE FUNCTION has to prevent reducing the pronargdefaults > value of an existing function (ie, you can add more defaults but not > remove any). This ensures a function that matched a given call before >

[HACKERS] Summary: changes needed in function defaults behavior

2008-12-17 Thread Tom Lane
So to summarize what I think we agreed to yesterday: * CREATE OR REPLACE FUNCTION has to prevent reducing the pronargdefaults value of an existing function (ie, you can add more defaults but not remove any). This ensures a function that matched a given call before will continue to do so. * CREAT