Re: How to grant read only functions execute permission to read only user

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Yi Sun <yinan81(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to grant read only functions execute permission to read only user
Date: 2023-07-17 15:43:48
Message-ID: bbde2d6f-aa8c-bbab-ddda-0ba35019160d@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/17/23 16:11, Yi Sun wrote:
> Hello guys,
>
> Our read only user is okay to be granted read only permission of tables.
>
> How to grant read only functions execute permission to read only user,
> is there a simple way to do it please? If not, how to get the list of
> read only functions please? Then can grant one by one based on the list,
> thanks

What is read-only function? I don't think Postgres has anything like
that. Functions inherit the privileges of the user that executes them by
default. So if the user is read-only (i.e. has just SELECT privilege),
then the function can't do any writes either.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-07-17 15:49:23 Re: How to grant read only functions execute permission to read only user
Previous Message Adrian Klaver 2023-07-17 14:30:45 Re: Installation Issue