pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: connect permission based on database name
Date: Wed, 25 May 2022 08:38:31 -0600
Message-ID: <cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.com> (raw)
In-Reply-To: <1920549.1653488423@sss.pgh.pa.us>
References: <3659d499-9a98-6362-7c33-d8f2947474b4@gmail.com>
	<1920549.1653488423@sss.pgh.pa.us>

On 5/25/22 08:20, Tom Lane wrote:
> Rob Sargent<robjsargent@gmail.com>  writes:
>> Just wondering if I've bumped into some security issue.
>> I'm somewhat surprised that "grant connect to database <dbname>  to
>> <role>" appears to be stored "by name"?
> I think you are forgetting that databases have a default GRANT CONNECT
> TO PUBLIC.  You need to revoke that before other grants/revokes will
> have any functional effect.
>
> 			regards, tom lane
And then the search path is "just a string"?

    psql --user oldrole --dbname newdb --host $DBHOST
    psql (12.11, server 12.7)
    SSL connection (protocol: TLSv1.2, cipher:
    ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
    Type "help" for help.

    newdb=> show search_path;
         search_path
    --------------------
      study, base, public
    (1 row)

view thread (6+ messages)  latest in thread

Message-ID: <cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.com>
Permalink:  ../cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.com/
Also on:    postgresql.org/message-id/cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.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: robjsargent@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: connect permission based on database name
  In-Reply-To: <cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.com>
  References: <3659d499-9a98-6362-7c33-d8f2947474b4@gmail.com> <1920549.1653488423@sss.pgh.pa.us> <cb6ebae1-2ee9-df60-54b7-00d0f4810850@gmail.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