pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chris <chrisk@pgsqlrocket.com>
To: Postgres General <pgsql-general@postgresql.org>
Subject: gathering ownership and grant permissions
Date: Fri, 16 Feb 2018 12:47:08 -0700
Message-ID: <2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.com> (raw)

HI,

I would like to know if there is a better way to grab the grant 
permissions  as well as the "owner to" of a table.

I can currently do this through a pg_dumb with greps for "^grant" and 
"^alter" but than I need to do a word search of those lines looking for 
the specific answers which gets much more involved.

I essentially need to know what grant command was ran and use that grant 
permission to set to a variable for a script.

Ex: GRANT ALL ON TABLE testing TO bob; then set only the "all" to a 
variable.

And then same for the ALTER .... OWNER TO bob.

This is on postgresl 9.6.

Thank you,

Chris





view thread (5+ messages)  latest in thread

Message-ID: <2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.com>
Permalink:  ../2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.com/
Also on:    postgresql.org/message-id/2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.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: chrisk@pgsqlrocket.com
  Subject: Re: gathering ownership and grant permissions
  In-Reply-To: <2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.com>
  References: <2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.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