diff options
Diffstat (limited to 'src/backend/replication')
| -rw-r--r-- | src/backend/replication/logical/logicalfuncs.c | 16 | ||||
| -rw-r--r-- | src/backend/replication/slotfuncs.c | 3 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c index 1977f098c79..1a38f56a7cc 100644 --- a/src/backend/replication/logical/logicalfuncs.c +++ b/src/backend/replication/logical/logicalfuncs.c @@ -17,18 +17,14 @@ #include <unistd.h> +#include "access/xlog_internal.h" +#include "catalog/pg_type.h" #include "fmgr.h" #include "funcapi.h" +#include "mb/pg_wchar.h" #include "miscadmin.h" - -#include "access/xlog_internal.h" - -#include "catalog/pg_type.h" - #include "nodes/makefuncs.h" - -#include "mb/pg_wchar.h" - +#include "utils/acl.h" #include "utils/array.h" #include "utils/builtins.h" #include "utils/inval.h" @@ -36,11 +32,9 @@ #include "utils/pg_lsn.h" #include "utils/resowner.h" #include "utils/lsyscache.h" - #include "replication/decode.h" #include "replication/logical.h" #include "replication/logicalfuncs.h" - #include "storage/fd.h" /* private date for writing out data */ @@ -205,7 +199,7 @@ XLogRead(char *buf, TimeLineID tli, XLogRecPtr startptr, Size count) static void check_permissions(void) { - if (!superuser() && !has_rolreplication(GetUserId())) + if (!have_role_attribute(ROLE_ATTR_REPLICATION)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser or replication role to use replication slots")))); diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index bd4701f97df..c113a0bbaa7 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -20,13 +20,14 @@ #include "replication/slot.h" #include "replication/logical.h" #include "replication/logicalfuncs.h" +#include "utils/acl.h" #include "utils/builtins.h" #include "utils/pg_lsn.h" static void check_permissions(void) { - if (!superuser() && !has_rolreplication(GetUserId())) + if (!have_role_attribute(ROLE_ATTR_REPLICATION)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser or replication role to use replication slots")))); |
