pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: William Edwards <wedwards@cyberfusion.nl>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Sample pg_hba.conf allows local users to access all databases
Date: Tue, 1 Aug 2023 10:34:54 -0700
Message-ID: <1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.com> (raw)
In-Reply-To: <07a0ac4f2b98152f355c64e967763924@cyberfusion.nl>
References: <07a0ac4f2b98152f355c64e967763924@cyberfusion.nl>



> On Aug 1, 2023, at 10:13, William Edwards <wedwards@cyberfusion.nl> wrote:
> This allows all local users connecting over TCP to access all databases, not only the databases that the user is a member of as one might expect.

There's really no notion of a user being "a member of" a database in PostgreSQL.  Users are global resources, which are either granted access to a particular database, or aren't.

In your example, you explicitly grant access to the databases to the users you are creating.

Since a default installation of PostgreSQL contains only one superuser role, and the `postgres` database, any other access requires specific intervention on the part of someone with a superuser account.




view thread (4+ messages)  latest in thread

Message-ID: <1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.com>
Permalink:  ../1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.com/
Also on:    postgresql.org/message-id/1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.com

 · 

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 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: xof@thebuild.com, wedwards@cyberfusion.nl
  Subject: Re: Sample pg_hba.conf allows local users to access all databases
  In-Reply-To: <1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.com>
  References: <07a0ac4f2b98152f355c64e967763924@cyberfusion.nl> <1B165218-5DEF-45C7-8442-B6DC80EEB10D@thebuild.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