Re: machine-parseable object descriptions

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: machine-parseable object descriptions
Date: 2013-03-20 03:57:54
Message-ID: 20130320035754.GD3747@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> .. and here's the patch.

I forgot an example involving the funniest of all object classes:
default ACLs. Here it is.

alvherre=# create role rol1;
CREATE ROLE
alvherre=# create role rol2;
CREATE ROLE
alvherre=# create schema rol1 authorization rol1;
CREATE SCHEMA
alvherre=# alter default privileges for role rol1, rol2 grant insert on tables to alvherre;
ALTER DEFAULT PRIVILEGES
alvherre=# alter default privileges for role rol1 in schema rol1 grant insert on tables to alvherre;
ALTER DEFAULT PRIVILEGES
alvherre=# select oid,foo.* from pg_default_acl, lateral (select * from pg_identify_object(tableoid, oid, 0)) foo ;
oid | type | schema | name | identity
-------+-------------+--------+------+-------------------------------------
48839 | default acl | | | for role rol1 on tables
48840 | default acl | | | for role rol2 on tables
48844 | default acl | | | for role rol1 in schema rol1 on tables
(4 filas)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2013-03-20 05:37:59 Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)
Previous Message Alvaro Herrera 2013-03-20 03:48:41 Re: machine-parseable object descriptions