From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't pass "ONLY" options specified in TRUNCATE to foreign data
Date: Tue, 27 Apr 2021 05:42:18 +0000
Message-ID: <E1lbGUE-0002jS-C0@gemulon.postgresql.org> (raw)
Don't pass "ONLY" options specified in TRUNCATE to foreign data wrapper.
Commit 8ff1c94649 allowed TRUNCATE command to truncate foreign tables.
Previously the information about "ONLY" options specified in TRUNCATE
command were passed to the foreign data wrapper. Then postgres_fdw
constructed the TRUNCATE command to issue the remote server and
included "ONLY" options in it based on the passed information.
On the other hand, "ONLY" options specified in SELECT, UPDATE or DELETE
have no effect when accessing or modifying the remote table, i.e.,
are not passed to the foreign data wrapper. So it's inconsistent to
make only TRUNCATE command pass the "ONLY" options to the foreign data
wrapper. Therefore this commit changes the TRUNCATE command so that
it doesn't pass the "ONLY" options to the foreign data wrapper,
for the consistency with other statements. Also this commit changes
postgres_fdw so that it always doesn't include "ONLY" options in
the TRUNCATE command that it constructs.
Author: Fujii Masao
Reviewed-by: Bharath Rupireddy, Kyotaro Horiguchi, Justin Pryzby, Zhihong Yu
Discussion: https://postgr.es/m/551ed8c1-f531-818b-664a-2cecdab99cd8@oss.nttdata.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8e9ea08bae93a754d5075b7bc9c0b2bc71958bfd
Modified Files
--------------
contrib/postgres_fdw/deparse.c | 13 ++++------
contrib/postgres_fdw/expected/postgres_fdw.out | 24 ++++++++++++-------
contrib/postgres_fdw/postgres_fdw.c | 4 +---
contrib/postgres_fdw/postgres_fdw.h | 1 -
contrib/postgres_fdw/sql/postgres_fdw.sql | 16 +++++++++----
doc/src/sgml/fdwhandler.sgml | 29 ++++++++++------------
doc/src/sgml/postgres-fdw.sgml | 7 ++++++
src/backend/commands/tablecmds.c | 33 +++++++-------------------
src/backend/replication/logical/worker.c | 4 ----
src/include/commands/tablecmds.h | 11 ---------
src/include/foreign/fdwapi.h | 1 -
11 files changed, 60 insertions(+), 83 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org
Subject: Re: pgsql: Don't pass "ONLY" options specified in TRUNCATE to foreign data
In-Reply-To: <E1lbGUE-0002jS-C0@gemulon.postgresql.org>
References: <E1lbGUE-0002jS-C0@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox