From: Erik Wienhold <ewie@ewie.name>
To: Phani Prathyush Somayajula <phani.somayajula@pragmaticplay.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Restrict Write Users
Date: Tue, 20 Jun 2023 14:05:53 +0200 (CEST)
Message-ID: <4796978.1031811.1687262753268@office.mailbox.org> (raw)
In-Reply-To: <VI1PR10MB76716A9822F3326AF01E545C8D5CA@VI1PR10MB7671.EURPRD10.PROD.OUTLOOK.COM>
References: <VI1PR10MB76716A9822F3326AF01E545C8D5CA@VI1PR10MB7671.EURPRD10.PROD.OUTLOOK.COM>
> On 20/06/2023 13:23 CEST Phani Prathyush Somayajula <phani.somayajula@pragmaticplay.com> wrote:
>
> Is there a way to restrict write access to a user by restricting the user to
> have read-only on other databases on the instance. I’m using postgresql-14
> version
You should look into https://www.postgresql.org/docs/14/ddl-priv.html.
Start with a user that has no privileges and grant additional privileges as
necessary give read and/or write access. The user must not be the owner of
database objects, must not be a member of an owner role, and must not be
a superuser. Also check default privileges and privileges granted to PUBLIC.
But granting privileges in one database does not affect privileges in other
databases, except for role memberships because roles are not tied to a specific
database.
--
Erik
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ewie@ewie.name, phani.somayajula@pragmaticplay.com, pgsql-admin@lists.postgresql.org
Subject: Re: Restrict Write Users
In-Reply-To: <4796978.1031811.1687262753268@office.mailbox.org>
* 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