Thread: How to grant on all tables in pgAdmin4?

How to grant on all tables in pgAdmin4?

From
QA Collective
Date:
Hello,

I hope I've got the correct list for the pgAdmin4 web tool?

I just wanted to ask, how is it possible via pgAdmin4 UI to execute a command like:

GRANT SELECT ON ALL TABLES IN SCHEMA abc TO "viewer";

When I went to use the Grant Wizard, I selected the tickbox for all tables, but that resulted in SQL which granted select on each individual table...which isn't great for a database you expect to grow in tables in future.  Ideally, this would grant select on all tables as per the command above.

Then of course, there is the high chance I've missed something - given I'm relatively new to all of this.

Andrew

Re: How to grant on all tables in pgAdmin4?

From
Jack Royal-Gordon
Date:
Maybe I’m missing something here, but since pgAdmin includes a query window, you can connect to the server, open a
querywindow, type that command into the query window and then execute it. 

The query window is an alternative to the graphical interface. I would expect that just about anything you can do in
thegraphical interface can be accomplished in the query window (at least anything that resulted in one or more SQL
commandscertainly could). 

> On Sep 2, 2020, at 8:31 PM, QA Collective <theqacollective@gmail.com> wrote:
>
> Hello,
>
> I hope I've got the correct list for the pgAdmin4 web tool?
>
> I just wanted to ask, how is it possible via pgAdmin4 UI to execute a command like:
>
> GRANT SELECT ON ALL TABLES IN SCHEMA abc TO "viewer";
>
> When I went to use the Grant Wizard, I selected the tickbox for all tables, but that resulted in SQL which granted
selecton each individual table...which isn't great for a database you expect to grow in tables in future.  Ideally,
thiswould grant select on all tables as per the command above. 
>
> Then of course, there is the high chance I've missed something - given I'm relatively new to all of this.
>
> Andrew