Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1ECFF1337C19 for ; Wed, 30 Mar 2011 15:06:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 88663-06-3 for ; Wed, 30 Mar 2011 18:06:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id EF6D71337BF9 for ; Wed, 30 Mar 2011 15:06:10 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 30 Mar 2011 13:06:10 -0500 Message-Id: <4D932ABC020000250003BF9D@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 30 Mar 2011 13:06:04 -0500 From: "Kevin Grittner" To: "pgsql-admin@postgresql.org" , "Marc Fromm" Subject: Re: grant select script References: <93361C67E4EE844A80935863A4FF4B6C04E613C3@Exch2010MB-2.univ.dir.wwu.edu> In-Reply-To: <93361C67E4EE844A80935863A4FF4B6C04E613C3@Exch2010MB-2.univ.dir.wwu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/277 X-Sequence-Number: 37149 Marc Fromm 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