Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: WIP: default values for function parameters
Дата
Msg-id 162867790812120638j558aab5aldbbf2d33684215d9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: WIP: default values for function parameters  ("David E. Wheeler" <david@kineticode.com>)
Re: WIP: default values for function parameters  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
2008/12/12 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:
> David E. Wheeler wrote:
>>
>> Coming to this a bit late, but it seems to me that, while it makes sense
>> to assign a label to a value using "AS", it's kind of weird to use it to
>> assign a value to a label.
>>
>> SELECT foo( bar => 'ick', baz => 'ack' );
>> SELECT foo( bar AS 'ick', baz AS 'ack' );
>
> We could do it the other way round:
>
> SELECT foo( 'ick' AS bar, 'ack' AS baz);
>

I discussed about this form with Tom.

I thing so following should be readable:

name: [ optional => ] value
 SELECT foo( bar: 'ick', baz: 'ack' ); SELECT foo( bar: => 'ick', baz: => 'ack' );

or
 SELECT foo( bar: = 'ick', baz: = 'ack' );

reason for optional using of "=>" is too thin char ":", so =>
optically boost the colon.

Pavel



this is 100% compatible because syntax name: is new token

> --
>  Heikki Linnakangas
>  EnterpriseDB   http://www.enterprisedb.com
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: benchmarking the query planner
Следующее
От: "Greg Stark"
Дата:
Сообщение: Re: benchmarking the query planner