mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-22 14:27:00 +08:00
Improve generated column names for cases involving sub-SELECTs.
We'll now use "exists" for EXISTS(SELECT ...), "array" for ARRAY(SELECT ...), or the sub-select's own result column name for a simple expression sub-select. Previously, you usually got "?column?" in such cases. Marti Raudsepp, reviewed by Kyotaro Horiugchi
This commit is contained in:
@ -300,9 +300,9 @@ LINE 4: where sum(distinct a.four + b.four) = b.four)...
|
||||
select
|
||||
(select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
|
||||
from tenk1 o;
|
||||
?column?
|
||||
----------
|
||||
9999
|
||||
max
|
||||
------
|
||||
9999
|
||||
(1 row)
|
||||
|
||||
--
|
||||
|
||||
@ -490,20 +490,20 @@ select view_a from view_a;
|
||||
(1 row)
|
||||
|
||||
select (select view_a) from view_a;
|
||||
?column?
|
||||
----------
|
||||
view_a
|
||||
--------
|
||||
(42)
|
||||
(1 row)
|
||||
|
||||
select (select (select view_a)) from view_a;
|
||||
?column?
|
||||
----------
|
||||
view_a
|
||||
--------
|
||||
(42)
|
||||
(1 row)
|
||||
|
||||
select (select (a.*)::text) from view_a a;
|
||||
?column?
|
||||
----------
|
||||
a
|
||||
------
|
||||
(42)
|
||||
(1 row)
|
||||
|
||||
|
||||
@ -1065,7 +1065,7 @@ with cte(foo) as ( select 42 ) select * from ((select foo from cte)) q;
|
||||
select ( with cte(foo) as ( values(f1) )
|
||||
select (select foo from cte) )
|
||||
from int4_tbl;
|
||||
?column?
|
||||
foo
|
||||
-------------
|
||||
0
|
||||
123456
|
||||
@ -1077,7 +1077,7 @@ from int4_tbl;
|
||||
select ( with cte(foo) as ( values(f1) )
|
||||
values((select foo from cte)) )
|
||||
from int4_tbl;
|
||||
?column?
|
||||
column1
|
||||
-------------
|
||||
0
|
||||
123456
|
||||
|
||||
Reference in New Issue
Block a user