From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Yi Sun <yinan81@gmail.com>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: How to grant read only functions execute permission to read only user
Date: Mon, 17 Jul 2023 17:43:48 +0200
Message-ID: <bbde2d6f-aa8c-bbab-ddda-0ba35019160d@enterprisedb.com> (raw)
In-Reply-To: <CABWY_HBa_NDX9==b1zmXi97-hDV01JMwtshOF08pu5QHPz=UpQ@mail.gmail.com>
References: <CABWY_HBa_NDX9==b1zmXi97-hDV01JMwtshOF08pu5QHPz=UpQ@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tomas.vondra@enterprisedb.com, yinan81@gmail.com
Subject: Re: How to grant read only functions execute permission to read only user
In-Reply-To: <bbde2d6f-aa8c-bbab-ddda-0ba35019160d@enterprisedb.com>
References: <CABWY_HBa_NDX9==b1zmXi97-hDV01JMwtshOF08pu5QHPz=UpQ@mail.gmail.com> <bbde2d6f-aa8c-bbab-ddda-0ba35019160d@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox