summaryrefslogtreecommitdiff
path: root/src/backend/replication/slot.c
diff options
context:
space:
mode:
authorPeter Eisentraut2023-03-17 09:14:16 +0000
committerPeter Eisentraut2023-03-17 09:33:09 +0000
commitde4d456b406bf502341ef526710d3f764b41e2c8 (patch)
tree9a5ae6a1fb699d41d38b430dab4d2b6dfa716419 /src/backend/replication/slot.c
parent39a3bdc9eba50628cecb7e3cada95271180c8744 (diff)
Improve several permission-related error messages.
Mainly move some detail from errmsg to errdetail, remove explicit mention of superuser where appropriate, since that is implied in most permission checks, and make messages more uniform. Author: Nathan Bossart <[email protected]> Discussion: https://www.postgresql.org/message-id/20230316234701.GA903298@nathanxps13
Diffstat (limited to 'src/backend/replication/slot.c')
-rw-r--r--src/backend/replication/slot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 3506b77cc7c..2293c0c6fc3 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -1143,7 +1143,9 @@ CheckSlotPermissions(void)
if (!has_rolreplication(GetUserId()))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser or replication role to use replication slots")));
+ errmsg("permission denied to use replication slots"),
+ errdetail("Only roles with the %s attribute may use replication slots.",
+ "REPLICATION")));
}
/*