X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 77F7BD1C9F9 for ; Fri, 1 Aug 2003 20:15:23 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66782-07 for ; Fri, 1 Aug 2003 17:14:05 -0300 (ADT) Received: from trade-india.com (ns5.trade-india.com [66.234.10.13]) by svr1.postgresql.org (Postfix) with SMTP id 36C38D1C9EE for ; Fri, 1 Aug 2003 17:15:10 -0300 (ADT) Received: (qmail 800 invoked by uid 0); 1 Aug 2003 20:14:35 -0000 Received: from mallah@trade-india.com by ns5.trade-india.com by uid 502 with qmail-scanner-1.15 (uvscan: v4.1.60/v4171. Clear:. Processed in 0.932266 secs); 01 Aug 2003 20:14:35 -0000 Received: from unknown (HELO trade-india.com) (203.145.130.142) by ns5.trade-india.com with SMTP; 1 Aug 2003 20:14:34 -0000 Message-ID: <3F2ACA58.4050004@trade-india.com> Date: Sat, 02 Aug 2003 01:45:20 +0530 From: Rajesh Kumar Mallah User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en-us, en MIME-Version: 1.0 To: MaRcElO PeReIrA Cc: pgsql-admin@postgresql.org Subject: Re: Grant on several tables at once References: <3F2AC832.7090803@yahoo.com.br> In-Reply-To: <3F2AC832.7090803@yahoo.com.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/32 X-Sequence-Number: 9755 if its possible to generate the list of tables from a sql query then do something like \o out.sql select ' grant select on table1 to ' || tablename || ' ;' ; \i out.sql regds mallah. MaRcElO PeReIrA wrote: > Hello All, > > I have a database that contain 72 tables. How can I grant "SELECT" on > all those 72 tables to a user, at once? > > I use to do: > > # grant select on table1 to marcelo; > # grant select on table2 to marcelo; > # ... > # grant select on table72 to marcelo; > > but it is a lot of tables... I would like to do this at once! > > Thanks in advance and > Best Regards, > > Marcelo > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings