From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
To: Marc Fromm <Marc.Fromm@wwu.edu>
Subject: Re: grant select script
Date: Wed, 30 Mar 2011 13:06:04 -0500
Message-ID: <4D932ABC020000250003BF9D@gw.wicourts.gov> (raw)
In-Reply-To: <93361C67E4EE844A80935863A4FF4B6C04E613C3@Exch2010MB-2.univ.dir.wwu.edu>
References: <93361C67E4EE844A80935863A4FF4B6C04E613C3@Exch2010MB-2.univ.dir.wwu.edu>
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
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, Marc.Fromm@wwu.edu
Subject: Re: grant select script
In-Reply-To: <4D932ABC020000250003BF9D@gw.wicourts.gov>
* 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