UNION ALL - Var attno

From: sri harsha <sriharsha9992(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: UNION ALL - Var attno
Date: 2016-04-29 03:55:41
Message-ID: CAP6OGLEO34adJ9sdN9bLn6vtyrSDJO6f5k2=2MSsBpXvCvTOfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Assume the following query ,

(SELECT a * 1 , b FROM TABLE_1) UNION ALL (SELECT a *1 , b FROM TABLE_2);

In this query , attribute number of the VARs are 141 and 2 respectively !!
What is the reason for this ??

I am trying to implement a FDW , so i need attribute numbers to fetch the
respective columns from my data store . Due to this change in attribute
numbers in the case of UNION ALL , this query doesn't provide the necessary
output .

But in the plan its given as 1 and 2 respectively . So is there a mapping
which PG maintains to convert from 141 to the original attribute number ??

Thanks,
Harsha

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2016-04-29 04:15:01 Re: VS 2015 support in src/tools/msvc
Previous Message Craig Ringer 2016-04-29 03:46:50 Re: pg_xlog -> pg_xjournal?