X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 85535474E42 for ; Wed, 23 Apr 2003 15:49:01 -0400 (EDT) Received: from fhcrc.org (uluc01.fhcrc.org [140.107.52.11]) by postgresql.org (Postfix) with ESMTP id 6B5B1474E42 for ; Wed, 23 Apr 2003 15:48:56 -0400 (EDT) Received: from e500b.fhcrc.org (e500b [140.107.52.110]) by fhcrc.org (8.10.2/8.10.2) with SMTP id h3NJmuV29406; Wed, 23 Apr 2003 12:48:56 -0700 (PDT) Received: from fred.fhcrc.org(140.107.32.92) by e500b.fhcrc.org via csmap id 21015; Wed, 23 Apr 2003 12:51:58 -0700 (PDT) Received: from localhost (sforteln@localhost) by fred.fhcrc.org (8.11.7+Sun/8.11.6) with ESMTP id h3NJmts22204; Wed, 23 Apr 2003 12:48:55 -0700 (PDT) X-Authentication-Warning: fred.fhcrc.org: sforteln owned process doing -bs Date: Wed, 23 Apr 2003 12:48:55 -0700 (PDT) From: Simon Fortelny X-X-Sender: sforteln@fred To: dudsen Cc: pgsql-admin@postgresql.org Subject: Re: GRANT on all tables? In-Reply-To: <1050499026.680723@kalvebod.groenjord.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-33.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REPLY_WITH_QUOTES,USER_AGENT_PINE,X_AUTH_WARNING autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/317 X-Sequence-Number: 8472 Can't remember where I found this but its worked in the past for granting privileges to all tables in a DB to a user. ./psql -t -A -U $OWNER -W -c "select tablename from pg_tables where tablename not like 'pg_%'" $mydatabase | xargs -i ./psql -U $OWNER -W -c "grant ALL on {} to $NEWUSER" $mydatabase -------------------------------------------------------------------------- Simon Fortelny Research Technician Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. D4-100 Seattle, WA 98109-1024 tel. 206.667.5618 email. sforteln@fred.fhcrc.org On Wed, 16 Apr 2003, dudsen wrote: > How do I GRANT an user privileges for all tables in an database with one > command, as it is now i need to specify the name of each table. > I want to write something like > GRANT SELECT,INSERT ON mydatabase TO user; this doesn't work but are there a > way of getting someting similar to work? > > -- > Daniel Udsen > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html >