unintuitive subquery record wrapping - Mailing list pgsql-general

From Rikard Pavelic
Subject unintuitive subquery record wrapping
Date
Msg-id 4C941CFB.5090401@zg.htnet.hr
Whole thread Raw
Responses Re: unintuitive subquery record wrapping  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm puzzled if this is by design or just overlooked...

create table t(a int, b varchar);

insert into t values(1,'x');

For basic query:
select t from t
result is of type t.

If I query:
select sq from (select t from t) sq;
result is of type record.

I need to query like this:
select (sq).t from (select t from t) sq;
or like this:
select t from (select t from t) t;
to get result of type t.

Wrapping t to record if another alias is used seems a bit unintuitive to me?
Is this by design and if yes, why?

Regards,
Rikard

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Referring to function parameter in function
Next
From: Tom Lane
Date:
Subject: Re: unintuitive subquery record wrapping