diff options
author | Fujii Masao | 2021-04-27 05:41:27 +0000 |
---|---|---|
committer | Fujii Masao | 2021-04-27 05:41:27 +0000 |
commit | 8e9ea08bae93a754d5075b7bc9c0b2bc71958bfd (patch) | |
tree | 317013f67abe8af08f2fae54493f8e45b49e0822 /src/include/commands/tablecmds.h | |
parent | 3fa17d37716f978f80dfcdab4e7c73f3a24e7a48 (diff) |
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/[email protected]
Diffstat (limited to 'src/include/commands/tablecmds.h')
-rw-r--r-- | src/include/commands/tablecmds.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h index b808a07e461..14f4b4882ff 100644 --- a/src/include/commands/tablecmds.h +++ b/src/include/commands/tablecmds.h @@ -21,16 +21,6 @@ #include "storage/lock.h" #include "utils/relcache.h" -/* - * These values indicate how a relation was specified as the target to - * truncate in TRUNCATE command. - */ -#define TRUNCATE_REL_CONTEXT_NORMAL 1 /* specified without ONLY clause */ -#define TRUNCATE_REL_CONTEXT_ONLY 2 /* specified with ONLY clause */ -#define TRUNCATE_REL_CONTEXT_CASCADING 3 /* not specified but truncated - * due to dependency (e.g., - * partition table) */ - struct AlterTableUtilityContext; /* avoid including tcop/utility.h here */ @@ -68,7 +58,6 @@ extern void CheckTableNotInUse(Relation rel, const char *stmt); extern void ExecuteTruncate(TruncateStmt *stmt); extern void ExecuteTruncateGuts(List *explicit_rels, List *relids, - List *relids_extra, List *relids_logged, DropBehavior behavior, bool restart_seqs); |