public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Graham Leggett <[email protected]>
Cc: [email protected]
Subject: Re: Grant read-only access to exactly one database amongst many
Date: Sun, 04 Feb 2024 19:53:52 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Graham Leggett <[email protected]> writes:
> Trouble is, I can create tables in db1 which is write access. I can also connect to db2 (bad), and I can enumerate the tables in db2 (bad), although the queries of the contents say access is denied.

You need to read the docs about default privileges: see about
halfway down

https://www.postgresql.org/docs/15/ddl-priv.html

where it says "PostgreSQL grants privileges on some types of objects
to PUBLIC by default ...".  In this case I think you likely need to
revoke the default public CREATE privilege on schema public in db1,
and revoke the default public CONNECT privilege on database db2.

			regards, tom lane






view thread (2+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Grant read-only access to exactly one database amongst many
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox