Re: idea: allow AS label inside ROW constructor

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: idea: allow AS label inside ROW constructor
Date: 2014-10-22 16:34:04
Message-ID: CAFj8pRA4rqJb91XKFnVy2H_A7+NFHQJNUOzJObJCwATaEM_u9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

here is a motivation, why I propose this feature

http://dba.stackexchange.com/questions/27732/set-names-to-attributes-when-creating-json-with-row-to-json

same query I have in Czech postgres users mailing list

Pavel

2014-10-22 18:21 GMT+02:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

> Hi
>
> with new functions row_to_json(b), there is more often usage of ROW
> constructor. Using names in fields is relative difficult. Because ROW has
> special clause in parser, I am thinking so we can enable labeling inside
> ROW constructor
>
> so instead currently supported:
>
> select row_to_json(r) from (select 10 as a, 20 as b) r;
>
> users can to write:
>
> select row_to_json(row(10 as a,20 as b));
>
> labeling will be enabled "only" inside ROW constructor. I don't propose
> enable it everywhere.
>
> What do you think about it?
>
> Regards
>
> Pavel
>
> Currently supported syntax is natural for long time PostgreSQL user, but
> it is relative strange for usual user.
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2014-10-22 16:35:19 Re: idea: allow AS label inside ROW constructor
Previous Message Pavel Stehule 2014-10-22 16:21:40 idea: allow AS label inside ROW constructor