BUG #14249: In FDW, variable not found in subplan target list

Started by Nonamealmost 10 years ago2 messagesbugs
Jump to latest
#1Noname
wayne.warren@multiscalehn.com

The following bug has been logged on the website:

Bug reference: 14249
Logged by: Wayne Warren
Email address: wayne.warren@multiscalehn.com
PostgreSQL version: 9.6beta2
Operating system: Ubuntu 14
Description:

I have written a foreign data wrapper that works with version 9.5.2. Now
with 9.6beta2 I receive "ERROR: variable not found in subplan target list"
when I refer to a column in the WHERE clause that is not also listed as a
target column:

mydb=# select record_id, addr_chg_user_id from si_ept_470
where addr_chg_instant='5441342125';
ERROR: variable not found in subplan target list

When the column is included in the target list, the correct results are
produced.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: BUG #14249: In FDW, variable not found in subplan target list

wayne.warren@multiscalehn.com writes:

I have written a foreign data wrapper that works with version 9.5.2. Now
with 9.6beta2 I receive "ERROR: variable not found in subplan target list"
when I refer to a column in the WHERE clause that is not also listed as a
target column:

mydb=# select record_id, addr_chg_user_id from si_ept_470
where addr_chg_instant='5441342125';
ERROR: variable not found in subplan target list

No such misbehavior is visible in file_fdw or postgres_fdw, so presumably
your FDW is doing something wrong. There's not enough information here
to say what; though a likely guess is that you're building a custom
fdw_scan_tlist and forgetting to include Vars from restriction clauses
in it.

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs