Re: default privileges

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: Radovan Jablonovsky <radovan(dot)jablonovsky(at)replicon(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: default privileges
Date: 2014-04-17 16:08:31
Message-ID: CA+h6AhhH18ykyhT-1j3AUCmPQrN==td_12n1Avqiw9Vfwa_WGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Apr 17, 2014 at 9:04 PM, Radovan Jablonovsky <
radovan(dot)jablonovsky(at)replicon(dot)com> wrote:

> Metadata Information about assigned "define default access privileges"
> based on documentation is possible retrieve using psql command "\ddp". I
> was looking on google an inside system tables, but was not able to figure
> out where is the information stored (resp how to retrieve it) from system
> tables/functions. Could you point to correct direction?
>
> You can find out where that information captured by meta-commands by
connecting to psql with "-E"​ option(display queries that internal commands
generate)

-bash-4.1$ psql -E
psql.bin (9.3.4)
Type "help" for help.

postgres=# \ddp
********* QUERY **********
SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS "Owner",
n.nspname AS "Schema",
CASE d.defaclobjtype WHEN 'r' THEN 'table' WHEN 'S' THEN 'sequence' WHEN
'f' THEN 'function' WHEN 'T' THEN 'type' END AS "Type",
pg_catalog.array_to_string(d.defaclacl, E'\n') AS "Access privileges"
FROM pg_catalog.pg_default_acl d
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.defaclnamespace
ORDER BY 1, 2, 3;
**************************

Default access privileges
Owner | Schema | Type | Access privileges
-------+--------+------+-------------------
(0 rows)

Hope its clear now from where its getting the details.
http://www.postgresql.org/docs/current/static/catalog-pg-default-acl.html​

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

> Sincerely,
> --
>
> *Radovan Jablonovsky* | SaaS DBA | Phone 1-403-262-6519 (ext. 256) | Fax
> 1-403-233-8046
>
>
>
> * Replicon | Hassle-Free Time & Expense Management Software - 7,300
> Customers - 70 Countrieswww.replicon.com
> <http://www.replicon.com/> | facebook
> <http://www.facebook.com/Replicon.inc> | twitter
> <http://twitter.com/Replicon> | blog
> <http://www.replicon.com/blog/> | contact us
> <http://www.replicon.com/about_replicon/contact_us.aspx> We are
> hiring! | search jobs
> <http://tbe.taleo.net/NA2/ats/careers/searchResults.jsp?org=REPLICON&cws=1&act=sort&sortColumn=1&__utma=1.651918544.1299001662.1299170819.1299174966.10&__utmb=1.8.10.1299174966&__utmc=1&__utmx=-&__utmz=1.1299174985.10.3.utmcsr=google%7Cutmccn=(organic)%7Cutmcmd=organic%7Cutmctr=replicon%20careers&__utmv=1.%7C3=Visitor%20Type=Prospects=1,&__utmk=40578466>
> *
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Oscar Calderon 2014-04-18 02:44:05 Difference between fsync and open_sync
Previous Message Radovan Jablonovsky 2014-04-17 15:34:43 default privileges