Re: Postgres_fdw join pushdown - wrong results with whole-row reference - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Postgres_fdw join pushdown - wrong results with whole-row reference
Date
Msg-id CAFjFpRfYcS_qQzdbZ8s9OZdbuLH0dBKSKkPn3D2-k=dMa8T0NA@mail.gmail.com
Whole thread Raw
In response to Re: Postgres_fdw join pushdown - wrong results with whole-row reference  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: Postgres_fdw join pushdown - wrong results with whole-row reference  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers




How about using a system column eg, ctid, for the CASE WHEN conversion; in Rushabh's example the reference to "r1" would be converted with "CASE WHEN r1.ctid IS NOT NULL THEN ROW(r1.empno, r1.ename, r1.job, r1.mgr, r1.hiredate, r1.sal, r1.comm, r1.deptno) END".  IMO I think that that would be much simpler than Ashutosh's approach.


A foreign table can have a view, a regular table, another foreign table or a materialised view a its target. A view does not support any of the system columns, so none of them are available.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: Postgres_fdw join pushdown - wrong results with whole-row reference
Next
From: Etsuro Fujita
Date:
Subject: Re: Postgres_fdw join pushdown - wrong results with whole-row reference