Skip to content

Commit 2ade0e0

Browse files
author
Antonin Houska
committed
Make privileges check consistent with the other ones.
1 parent 6e1f4f4 commit 2ade0e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pgstatapprox.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ squeeze_pgstattuple_approx(PG_FUNCTION_ARGS)
248248
HeapTuple ret;
249249
int i = 0;
250250

251-
if (!superuser())
251+
if (!superuser() && !has_rolreplication(GetUserId()))
252252
ereport(ERROR,
253253
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
254-
(errmsg("must be superuser to use pgstattuple functions"))));
254+
(errmsg("must be superuser or replication role to run this function"))));
255+
255256

256257
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
257258
elog(ERROR, "return type must be a row type");

0 commit comments

Comments
 (0)