Re: Targetlist lost when CTE join <targetlist lost when CTE join>

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Targetlist lost when CTE join <targetlist lost when CTE join>
Date: 2023-06-28 09:23:59
Message-ID: 4cefe418-d0d9-4d14-94a9-dff0d26c3d71@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2023-06-28 09:26:10 Re: Targetlist lost when CTE join <targetlist lost when CTE join>
Previous Message Julien Rouhaud 2023-06-28 09:17:14 Re: Targetlist lost when CTE join <targetlist lost when CTE join>