aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2025-07-11 11:51:25 -0500
committerNathan Bossart <nathan@postgresql.org>2025-07-11 11:51:25 -0500
commita4f126516e688736bfed332b44a0c221b8dc118a (patch)
treeb921beb43ae0acd7a8ce510896e2c6d1b06fd831 /src/backend/tcop
parentbb938e2c3c7a955090f8b68b5bf75d064f6a36a0 (diff)
downloadpostgresql-a4f126516e688736bfed332b44a0c221b8dc118a.tar.gz
postgresql-a4f126516e688736bfed332b44a0c221b8dc118a.zip
Add option list to CHECKPOINT command.
This commit adds the boilerplate code for supporting a list of options in CHECKPOINT commands. No actual options are supported yet, but follow-up commits will add support for MODE and FLUSH_UNLOGGED. While at it, this commit refactors the code for executing CHECKPOINT commands to its own function since it's about to become significantly larger. Author: Christoph Berg <myon@debian.org> Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com> Discussion: https://postgr.es/m/aDnaKTEf-0dLiEfz%40msg.df7cb.de
Diffstat (limited to 'src/backend/tcop')
-rw-r--r--src/backend/tcop/utility.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index a628da4b145..4c1faf5575c 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -943,17 +943,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
break;
case T_CheckPointStmt:
- if (!has_privs_of_role(GetUserId(), ROLE_PG_CHECKPOINT))
- ereport(ERROR,
- (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- /* translator: %s is name of a SQL command, eg CHECKPOINT */
- errmsg("permission denied to execute %s command",
- "CHECKPOINT"),
- errdetail("Only roles with privileges of the \"%s\" role may execute this command.",
- "pg_checkpoint")));
-
- RequestCheckpoint(CHECKPOINT_FAST | CHECKPOINT_WAIT |
- (RecoveryInProgress() ? 0 : CHECKPOINT_FORCE));
+ ExecCheckpoint(pstate, (CheckPointStmt *) parsetree);
break;
/*