pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Mathieu PUJOL <mathieu.pujol@realfusio.com>
To: pgsql-general@postgresql.org
Subject: Re: Analyze plan of foreign data wrapper
Date: Thu, 28 Jun 2018 23:17:44 +0200
Message-ID: <1530220664.3220.2.camel@cybertec.at> (raw)
In-Reply-To: <CAH_OVQFq3Nb9oNkHsqHnfbWxGPD5tu3E2gfZgZ34OzVB0_JQiA@mail.gmail.com>
References: <CAH_OVQFq3Nb9oNkHsqHnfbWxGPD5tu3E2gfZgZ34OzVB0_JQiA@mail.gmail.com>

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




view thread (5+ messages)  latest in thread

Message-ID: <1530220664.3220.2.camel@cybertec.at>
Permalink:  ../1530220664.3220.2.camel@cybertec.at/
Also on:    postgresql.org/message-id/1530220664.3220.2.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, mathieu.pujol@realfusio.com
  Subject: Re: Analyze plan of foreign data wrapper
  In-Reply-To: <1530220664.3220.2.camel@cybertec.at>
  References: <CAH_OVQFq3Nb9oNkHsqHnfbWxGPD5tu3E2gfZgZ34OzVB0_JQiA@mail.gmail.com> <1530220664.3220.2.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox