Decoding proacl

From: Benedikt Grundmann <bgrundmann(at)janestreet(dot)com>
To: PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Decoding proacl
Date: 2016-10-03 10:48:15
Message-ID: CADbMkNOae7c4G11MHAe_8oRY8PnJzJ+V4WgV=_B=ej8an8jXnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm trying to understand how to decode proacl in pg_proc. The
documentation says:

PostgreSQL grants default privileges on some types of objects to PUBLIC.
... EXECUTE privilege for functions; ... Also, these initial default
privilege settings can be changed using the ALTER DEFAULT PRIVILEGES
command.

I also found this email
<https://www.postgresql.org/message-id/7646.1357696137@sss.pgh.pa.us> by
Tom saying that NULL means the default of execute to public.

Questions:

a) Does NULL mean execute to public? Or does it mean whatever
pg_default_acl contains for functions?

b) What does it mean if pg_default_acl is empty?

c) If NULL means execute to public can somebody explain why this happens:

postgres_prod(at)proddb_testing=# select proacl from pg_proc where proname =
'hstore_eq';
─[ RECORD 1 ]
proacl │ ¤

Time: 87.862 ms
postgres_prod(at)proddb_testing=# grant execute on function hstore_eq(hstore,
hstore) to public;
GRANT
Time: 88.931 ms
postgres_prod(at)proddb_testing=# select proacl from pg_proc where proname =
'hstore_eq';
─[ RECORD 1 ]────────────────────────────────────────────
proacl │ *{=X/postgres_prod,postgres_prod=X/postgres_prod}*

I would have expected the bold to still be NULL. Also I haven't found any
combination of statements to set it back to NULL (short of dropping and
recreating hstore_eq).

Which leads me to I guess the most important questions.

d) Other than compactness in the representation of acls is there any
practical difference between an the above representation and having NULL in
proacl?

Thanks in advance,

Bene

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-10-03 11:25:17 Re: multivariate statistics (v19)
Previous Message Kyotaro HORIGUCHI 2016-10-03 10:46:32 Re: asynchronous execution