Hi
Regards,
Zhang Mingli
On Jun 28, 2023, 17:17 +0800, Julien Rouhaud <rjuju123(at)gmail(dot)com>, wrote:
> This is working as intended. When using a USING clause you "merge" both
> columns so the final target list only contain one version of the merged
> columns, which doesn't happen if you use e.g. ON instead. I'm assuming that
> what the SQL standard says, but I don't have a copy to confirm.
Thanks. You’r right.
Have a test:
gpadmin=# with cte1 as (insert into t2 values (1, 2) returning *) select * from cte1 join t1 on t1.c1 = cte1.c1;
c1 | c2 | c1 | c2
----+----+----+----
(0 rows)