|
|
@ -24,6 +24,7 @@ |
|
|
|
#include "catalog/catalog.h" |
|
|
|
#include "catalog/catalog.h" |
|
|
|
#include "catalog/index.h" |
|
|
|
#include "catalog/index.h" |
|
|
|
#include "catalog/namespace.h" |
|
|
|
#include "catalog/namespace.h" |
|
|
|
|
|
|
|
#include "catalog/pg_authid.h" |
|
|
|
#include "catalog/pg_inherits.h" |
|
|
|
#include "catalog/pg_inherits.h" |
|
|
|
#include "catalog/toasting.h" |
|
|
|
#include "catalog/toasting.h" |
|
|
|
#include "commands/alter.h" |
|
|
|
#include "commands/alter.h" |
|
|
@ -939,10 +940,10 @@ standard_ProcessUtility(PlannedStmt *pstmt, |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case T_CheckPointStmt: |
|
|
|
case T_CheckPointStmt: |
|
|
|
if (!superuser()) |
|
|
|
if (!has_privs_of_role(GetUserId(), ROLE_PG_CHECKPOINTER)) |
|
|
|
ereport(ERROR, |
|
|
|
ereport(ERROR, |
|
|
|
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), |
|
|
|
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), |
|
|
|
errmsg("must be superuser to do CHECKPOINT"))); |
|
|
|
errmsg("must be superuser or have privileges of pg_checkpointer to do CHECKPOINT"))); |
|
|
|
|
|
|
|
|
|
|
|
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_WAIT | |
|
|
|
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_WAIT | |
|
|
|
(RecoveryInProgress() ? 0 : CHECKPOINT_FORCE)); |
|
|
|
(RecoveryInProgress() ? 0 : CHECKPOINT_FORCE)); |
|
|
|