How to rename each field in ROW expression? - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject How to rename each field in ROW expression?
Date
Msg-id AANLkTikYqoC1VzjmdSM4hvnHoXDRexG7ZOajp6=P6f9G@mail.gmail.com
Whole thread Raw
Responses Re: How to rename each field in ROW expression?
List pgsql-hackers
We can rename each field in VALUES clause:

=# SELECT * FROM (VALUES(123, 'ABC', NULL)) AS t(a,b,c); a  |  b  | c
-----+-----+---123 | ABC |
(1 row)

But I cannot find ways for ROW expression to do the same thing:

=# SELECT ROW(123, 'ABC', NULL) AS (a,b,c);
ERROR:  syntax error at or near "("
LINE 1: SELECT ROW(123, 'ABC', NULL) AS (a,b,c);                                       ^
=# SELECT (ROW(123, 'ABC', NULL)).*;
ERROR:  record type has not been registered

Is it possible to change names fields in ROW?
We can use CREATE TYPE AS on ahead, but I'd like to
change names of ROW expression in ad-hoc queries.

-- 
Itagaki Takahiro


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: [COMMITTERS] pgsql: Improved parallel make support
Next
From: Pavel Stehule
Date:
Subject: Re: Per-column collation