Re: grant select script

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>, "Marc Fromm" <Marc(dot)Fromm(at)wwu(dot)edu>
Subject: Re: grant select script
Date: 2011-03-30 18:06:04
Message-ID: 4D932ABC020000250003BF9D@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Marc Fromm <Marc(dot)Fromm(at)wwu(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bob Lunney 2011-03-30 18:06:21 Re: grant select script
Previous Message Marc Fromm 2011-03-30 17:54:16 grant select script