aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogfuncs.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-23 15:35:49 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-23 15:35:49 -0300
commita609d96778c1714b9af916477b2c30891fbe578a (patch)
tree66b7073c9e67e708136d3c3450d7cbdd81b06a73 /src/backend/access/transam/xlogfuncs.c
parentd7ee82e50f624221db76023c17137661fe69ec61 (diff)
downloadpostgresql-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/access/transam/xlogfuncs.c')
-rw-r--r--src/backend/access/transam/xlogfuncs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c
index 3181a79e3ed..133143db929 100644
--- a/src/backend/access/transam/xlogfuncs.c
+++ b/src/backend/access/transam/xlogfuncs.c
@@ -27,7 +27,6 @@
#include "miscadmin.h"
#include "replication/walreceiver.h"
#include "storage/smgr.h"
-#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/numeric.h"
#include "utils/guc.h"
@@ -55,7 +54,7 @@ pg_start_backup(PG_FUNCTION_ARGS)
backupidstr = text_to_cstring(backupid);
- 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 run a backup")));
@@ -83,7 +82,7 @@ pg_stop_backup(PG_FUNCTION_ARGS)
{
XLogRecPtr stoppoint;
- 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 run a backup"))));