postgresql/contrib/postgres_fdw
Tom Lane 462bd95705 Fix planning of SELECT FOR UPDATE on child table with partial index.
Ordinarily we can omit checking of a WHERE condition that matches a partial
index's condition, when we are using an indexscan on that partial index.
However, in SELECT FOR UPDATE we must include the "redundant" filter
condition in the plan so that it gets checked properly in an EvalPlanQual
recheck.  The planner got this mostly right, but improperly omitted the
filter condition if the index in question was on an inheritance child
table.  In READ COMMITTED mode, this could result in incorrectly returning
just-updated rows that no longer satisfy the filter condition.

The cause of the error is using get_parse_rowmark() when get_plan_rowmark()
is what should be used during planning.  In 9.3 and up, also fix the same
mistake in contrib/postgres_fdw.  It's currently harmless there (for lack
of inheritance support) but wrong is wrong, and the incorrect code might
get copied to someplace where it's more significant.

Report and fix by Kyotaro Horiguchi.  Back-patch to all supported branches.
2014-12-11 21:02:25 -05:00
..
expected Fix mishandling of system columns in FDW queries. 2014-11-22 16:01:05 -05:00
sql Fix mishandling of system columns in FDW queries. 2014-11-22 16:01:05 -05:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
deparse.c Fix mishandling of system columns in FDW queries. 2014-11-22 16:01:05 -05:00
Makefile Fix SHLIB_PREREQS use in contrib, allowing PGXS builds 2014-12-04 07:58:12 -05:00
option.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix planning of SELECT FOR UPDATE on child table with partial index. 2014-12-11 21:02:25 -05:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h postgres_fdw.h: don't pull in rel.h when relcache.h is enough 2014-11-14 21:48:53 -03:00