Re: grant select script - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: grant select script
Date
Msg-id 4D932ABC020000250003BF9D@gw.wicourts.gov
Whole thread Raw
In response to grant select script  (Marc Fromm <Marc.Fromm@wwu.edu>)
List pgsql-admin
Marc Fromm <Marc.Fromm@wwu.edu> wrote:

> I am working with a script to automate grant select to all tables
> in a database to a user.

You don't say what version you're using, but if it's available, you
might want to use the GRANT SELECT ON ALL TABLES IN SCHEMA syntax.

> The data base cswe2 does not contain the table sql_languages,
> unless it is hidden. Is there a way to tell the script to ignore
> them?
> GRANT SELECT ON TABLE sql_languages to tom;
> ERROR:  relation "sql_languages" does not exist

It looks like you're not dealing with schema properly.  To learn how
to write queries for that, it can help to run psql with the -E
switch and use the \d commands.

-Kevin

pgsql-admin by date:

Previous
From: Marc Fromm
Date:
Subject: grant select script
Next
From: Bob Lunney
Date:
Subject: Re: grant select script