pgsql: Fix mishandling of system columns in FDW queries.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix mishandling of system columns in FDW queries.
Дата
Msg-id E1XsHoK-0006lM-BR@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix mishandling of system columns in FDW queries.

postgres_fdw would send query conditions involving system columns to the
remote server, even though it makes no effort to ensure that system
columns other than CTID match what the remote side thinks.  tableoid,
in particular, probably won't match and might have some use in queries.
Hence, prevent sending conditions that include non-CTID system columns.

Also, create_foreignscan_plan neglected to check local restriction
conditions while determining whether to set fsSystemCol for a foreign
scan plan node.  This again would bollix the results for queries that
test a foreign table's tableoid.

Back-patch the first fix to 9.3 where postgres_fdw was introduced.
Back-patch the second to 9.2.  The code is probably broken in 9.1 as
well, but the patch doesn't apply cleanly there; given the weak state
of support for FDWs in 9.1, it doesn't seem worth fixing.

Etsuro Fujita, reviewed by Ashutosh Bapat, and somewhat modified by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9c58101117d25f174c8d8013befdc33c632922d0

Modified Files
--------------
contrib/postgres_fdw/deparse.c                 |   12 +++++
contrib/postgres_fdw/expected/postgres_fdw.out |   68 ++++++++++++++++++++++++
contrib/postgres_fdw/sql/postgres_fdw.sql      |   14 +++++
src/backend/optimizer/plan/createplan.c        |   24 ++++++++-
4 files changed, 116 insertions(+), 2 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix mishandling of system columns in FDW queries.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix mishandling of system columns in FDW queries.