diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-12-23 15:35:49 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-12-23 15:35:49 -0300 |
commit | a609d96778c1714b9af916477b2c30891fbe578a (patch) | |
tree | 66b7073c9e67e708136d3c3450d7cbdd81b06a73 /src/backend/replication/logical/logicalfuncs.c | |
parent | d7ee82e50f624221db76023c17137661fe69ec61 (diff) | |
download | postgresql-a609d96778c1714b9af916477b2c30891fbe578a.tar.gz postgresql-a609d96778c1714b9af916477b2c30891fbe578a.zip |
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.
Diffstat (limited to 'src/backend/replication/logical/logicalfuncs.c')
-rw-r--r-- | src/backend/replication/logical/logicalfuncs.c | 16 |
1 files changed, 11 insertions, 5 deletions
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 <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 "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")))); |