From: | "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | "Hannu Krosing" <hannu(at)2ndquadrant(dot)com> |
Cc: | "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: proposal sql: labeled function params |
Date: | 2008-08-16 06:38:41 |
Message-ID: | 162867790808152338h42b31d7bh80781565de655284@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2008/8/15 Hannu Krosing <hannu(at)2ndquadrant(dot)com>:
> On Fri, 2008-08-15 at 14:54 +0200, Pavel Stehule wrote:
>> 2008/8/15 Peter Eisentraut <peter_e(at)gmx(dot)net>:
>> > Am Thursday, 14. August 2008 schrieb Pavel Stehule:
>> >> I propose enhance current syntax that allows to specify label for any
>> >> function parameter:
>> >>
>> >> fcename(expr [as label], ...)
>> >> fcename(colname, ...)
>> >>
>> >> I would to allow same behave of custom functions like xmlforest function:
>> >> postgres=# select xmlforest(a) from foo;
>> >> xmlforest
>> >> -----------
>> >> <a>10</a>
>> >> (1 row)
>> >
>> > Do you have a use case for this outside of XML?
>> >
>>
>> JSON and similar (custom) protocols
>
> why not use a format string, or any other separate (sub)language ?
>
> select json('[name:$1, age: $2]', name, age) from students;
>
because you have to write labels, where labels are equal with column
names. I would to add same comfort like SQL/XML functions.
Pavel
> ------------
> Hannu
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2008-08-16 06:44:15 | Re: proposal sql: labeled function params |
Previous Message | Tom Lane | 2008-08-16 05:03:43 | Re: pgsql: Make the pg_stat_activity view call a SRF |