Re: proposal sql: labeled function params
От | Robert Haas |
---|---|
Тема | Re: proposal sql: labeled function params |
Дата | |
Msg-id | 603c8f070808171524te28290by24514303f237601e@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: proposal sql: labeled function params (Hannu Krosing <hannu@2ndQuadrant.com>) |
Ответы |
Re: proposal sql: labeled function params
|
Список | pgsql-hackers |
> Actually the most "natural" syntax to me is just f(name=value) similar > to how UPDATE does it. It has the added benefit of _not_ forcing us to > make a operator reserved (AFAIK "=" can't be used to define new ops) The problem with this is that SELECT foo(a = b) ...is already valid syntax. It means compare a with b and pass the resulting boolean to foo. I'm almost positive that changing this would break all kinds of existing code (and probably create a lot of grammar problems too). It's not an issue with SET because in that case the "name=" part of the syntax is required rather than optional. Any other operator you pick is going to have this same problem unless it's already impossible to use that operator as part of an expression.For that reason, while I'm not convinced of the valueof the feature, if we're going to support it then ISTM that expr AS label is the way to go. That also has the advantage of being consistent with the syntax for table and column aliasing. ...Robert
В списке pgsql-hackers по дате отправления: