Re: Analyze plan of foreign data wrapper

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Mathieu PUJOL <mathieu(dot)pujol(at)realfusio(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Analyze plan of foreign data wrapper
Date: 2018-06-28 21:17:44
Message-ID: 1530220664.3220.2.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mathieu PUJOL wrote:
> I'am writing a foreign data wrapper. To avoid returning data for a column that is not used, I parse 'targetlist' and 'qual' of the Plan.
> I'am able to find Var nodes but I can't figure out how i could now if this node is related to a column my foreign table.

For a Var v, v->varattno contains the attribute number of the column.
That is the same as the attnum column in pg_attribute.

If v->varattno == 0, it is a whole-row reference, like in

SELECT mytab FROM mytab;

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Munro 2018-06-28 22:13:05 Re: incorrect resource manager data checksum in record
Previous Message Adrian Klaver 2018-06-28 20:16:39 Re: plperl and plperlu language extentsions