From: Adrian Klaver <adrian.klaver@aklaver.com>
To: chris navarroza <canavarroza.work@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: system variable can be edited by all user?
Date: Tue, 22 Nov 2022 08:57:57 -0800
Message-ID: <de06aaf0-6319-2c04-2cff-6232c041f0ad@aklaver.com> (raw)
In-Reply-To: <CADRdQ7qAWHV1GHuofQGn4kn5pM4T5W5JsuNSOk8AkZ-Otpm_8w@mail.gmail.com>
References: <CADRdQ7qAWHV1GHuofQGn4kn5pM4T5W5JsuNSOk8AkZ-Otpm_8w@mail.gmail.com>
On 11/21/22 22:25, chris navarroza wrote:
> Hi,
>
> Ive created a read only user (SELECT PRIVILEGE) but it turns out that
> this user can do this queries: SHOW work_mem; SET work_mem='40MB'; How
> do I limit him?
Short answer is what Laurenz Albe posted.
Long answer is:
From:
https://www.postgresql.org/docs/current/view-pg-settings.html
select name, setting, context from pg_settings where name = 'work_mem';
name | setting | context
----------+---------+---------
work_mem | 4096 | user
user
These settings can be set from postgresql.conf, or within a session
via the SET command. Any user is allowed to change their session-local
value. Changes in postgresql.conf will affect existing sessions only if
no session-local value has been established with SET.
See page for the other possible values for context and what they mean
with regard to privileges.
>
> Thanks,
>
> Butching
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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: adrian.klaver@aklaver.com, canavarroza.work@gmail.com
Subject: Re: system variable can be edited by all user?
In-Reply-To: <de06aaf0-6319-2c04-2cff-6232c041f0ad@aklaver.com>
References: <CADRdQ7qAWHV1GHuofQGn4kn5pM4T5W5JsuNSOk8AkZ-Otpm_8w@mail.gmail.com> <de06aaf0-6319-2c04-2cff-6232c041f0ad@aklaver.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