Hi, Explain verbose, seems HashJoin node drop that column.
gpadmin=# explain(verbose) with cte1 as (insert into t2 values (1, 2) returning *) select * from cte1 join t1 using(c1); QUERY PLAN ------------------------------------------------------------------- Hash Join (cost=0.04..41.23 rows=11 width=12) Output: cte1.c1, cte1.c2, t1.c2 Hash Cond: (t1.c1 = cte1.c1) CTE cte1 -> Insert on public.t2 (cost=0.00..0.01 rows=1 width=8) Output: t2.c1, t2.c2 -> Result (cost=0.00..0.01 rows=1 width=8) Output: 1, 2 -> Seq Scan on public.t1 (cost=0.00..32.60 rows=2260 width=8) Output: t1.c1, t1.c2 -> Hash (cost=0.02..0.02 rows=1 width=8) Output: cte1.c1, cte1.c2 -> CTE Scan on cte1 (cost=0.00..0.02 rows=1 width=8) Output: cte1.c1, cte1.c2 (14 rows) Regards, Zhang Mingli