pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: NULL pg_database.datacl
Date: Mon, 20 Mar 2023 14:18:30 +0100 (CET)
Message-ID: <1479824139.962974.1679318310954@office.mailbox.org> (raw)
In-Reply-To: <CAFCRh-8o+Mn_KnT5DSVKgfkgFNLNy-3R52VLzVwBeY5EHqYhsw@mail.gmail.com>
References: <CAFCRh-83C18PKA7b=NNcxLF1FhBksot2v34ve0hR4ohrBAyL-w@mail.gmail.com>
	<1626848226.954543.1679314736718@office.mailbox.org>
	<CAFCRh-8o+Mn_KnT5DSVKgfkgFNLNy-3R52VLzVwBeY5EHqYhsw@mail.gmail.com>

> On 20/03/2023 13:50 CET Dominique Devienne <ddevienne@gmail.com> wrote:
>
> On Mon, Mar 20, 2023 at 1:18 PM Erik Wienhold <ewie@ewie.name> wrote:
> > > On 20/03/2023 11:52 CET Dominique Devienne <ddevienne@gmail.com> wrote:
> > > What does a NULL AclItem[] mean exactly?
> >
> >  It means that the object has default privileges (before any GRANT or REVOKE
> >  is executed). For databases this means full privileges for the database owner
> >  and the CONNECT and TEMPORARY privileges for PUBLIC. So any user can connect
> >  if allowed by pg_hba.conf.
> >
> >  https://www.postgresql.org/docs/current/ddl-priv.html
>
> Thanks Erik. But then, how come aclexplode() is not showing these
> default/implicit privileges?
>
> Is there a SQL function returning those per-type default provileges?
> That I could then coalesce() datacl with?

Use acldefault.  Pass in ownerId=0 to get the privileges for PUBLIC.

https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-ACLITEM-FN-TABLE

--
Erik





view thread (5+ messages)  latest in thread

Message-ID: <1479824139.962974.1679318310954@office.mailbox.org>
Permalink:  ../1479824139.962974.1679318310954@office.mailbox.org/
Also on:    postgresql.org/message-id/1479824139.962974.1679318310954@office.mailbox.org

 · 

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: ewie@ewie.name, ddevienne@gmail.com
  Subject: Re: NULL pg_database.datacl
  In-Reply-To: <1479824139.962974.1679318310954@office.mailbox.org>
  References: <CAFCRh-83C18PKA7b=NNcxLF1FhBksot2v34ve0hR4ohrBAyL-w@mail.gmail.com> <1626848226.954543.1679314736718@office.mailbox.org> <CAFCRh-8o+Mn_KnT5DSVKgfkgFNLNy-3R52VLzVwBeY5EHqYhsw@mail.gmail.com> <1479824139.962974.1679318310954@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