We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e1f4f4 commit 2ade0e0Copy full SHA for 2ade0e0
pgstatapprox.c
@@ -248,10 +248,11 @@ squeeze_pgstattuple_approx(PG_FUNCTION_ARGS)
248
HeapTuple ret;
249
int i = 0;
250
251
- if (!superuser())
+ if (!superuser() && !has_rolreplication(GetUserId()))
252
ereport(ERROR,
253
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
254
- (errmsg("must be superuser to use pgstattuple functions"))));
+ (errmsg("must be superuser or replication role to run this function"))));
255
+
256
257
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
258
elog(ERROR, "return type must be a row type");
0 commit comments