Search Postgresql Archives

unintuitive subquery record wrapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux