postgresql/contrib/postgres_fdw
Tom Lane da8f3ebf30 Don't convert Consts into Vars during setrefs.c processing.
While converting expressions in an upper-level plan node so that they
reference Vars and expressions provided by the input plan node(s),
don't convert plain Const items, even if there happens to be a matching
Const in the input.  It's silly to do so because a Var is more expensive to
execute than a Const.  Moreover, converting can fool ExecCheckPlanOutput's
check that an insert or update query inserts nulls into dropped columns,
leading to "query provides a value for a dropped column" errors during
INSERT or UPDATE on a table with a dropped column.  We could solve this
by making that check more complicated, but I don't see the point; this fix
should save a marginal number of cycles, and it also makes for less messy
EXPLAIN output, as shown by the ensuing regression test result changes.

Per report from Pavel Hanák.  I have not incorporated a test case based
on that example, as there doesn't seem to be a simple way of checking
this in isolation without making a bunch of assumptions about other
planner and SQL-function behavior.

Back-patch to 9.6.  This setrefs.c behavior exists much further back,
but there is not currently reason to think that it causes problems
before 9.6.

Discussion: <83shraampf.fsf@is-it.eu>
2016-11-02 14:32:13 -04:00
..
expected Don't convert Consts into Vars during setrefs.c processing. 2016-11-02 14:32:13 -04:00
sql postgres_fdw: Try again to stabilize aggregate pushdown regression tests. 2016-10-24 22:36:24 -04:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c Rename WAIT_* constants to PG_WAIT_*. 2016-10-05 08:04:52 -04:00
deparse.c postgres_fdw: Fix typo in comment. 2016-11-01 16:21:29 -04:00
Makefile Allow postgres_fdw to ship extension funcs/operators for remote execution. 2015-11-03 18:42:18 -05:00
option.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c postgres_fdw: Push down aggregates to remote servers. 2016-10-21 09:54:29 -04:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h postgres_fdw: Push down aggregates to remote servers. 2016-10-21 09:54:29 -04:00
shippable.c Update copyright for 2016 2016-01-02 13:33:40 -05:00