From a609d96778c1714b9af916477b2c30891fbe578a Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 23 Dec 2014 15:35:49 -0300 Subject: Revert "Use a bitmask to represent role attributes" This reverts commit 1826987a46d079458007b7b6bbcbbd852353adbb. The overall design was deemed unacceptable, in discussion following the previous commit message; we might find some parts of it still salvageable, but I don't want to be on the hook for fixing it, so let's wait until we have a new patch. --- src/backend/replication/logical/logicalfuncs.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/backend/replication/logical/logicalfuncs.c') diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c index 1a38f56a7cc..1977f098c79 100644 --- a/src/backend/replication/logical/logicalfuncs.c +++ b/src/backend/replication/logical/logicalfuncs.c @@ -17,14 +17,18 @@ #include -#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 "utils/acl.h" + +#include "mb/pg_wchar.h" + #include "utils/array.h" #include "utils/builtins.h" #include "utils/inval.h" @@ -32,9 +36,11 @@ #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 */ @@ -199,7 +205,7 @@ XLogRead(char *buf, TimeLineID tli, XLogRecPtr startptr, Size count) static void check_permissions(void) { - if (!have_role_attribute(ROLE_ATTR_REPLICATION)) + if (!superuser() && !has_rolreplication(GetUserId())) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser or replication role to use replication slots")))); -- cgit v1.2.3