X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B85AE9DCA19; Wed, 1 Mar 2006 18:12:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20669-05; Wed, 1 Mar 2006 18:12:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 466E89DC9E8; Wed, 1 Mar 2006 18:12:31 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id D72715646E; Wed, 1 Mar 2006 16:12:33 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Wed, 1 Mar 2006 16:12:33 -0600 Date: Wed, 1 Mar 2006 16:12:33 -0600 From: "Jim C. Nasby" To: AKHILESH GUPTA , pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] regarding grant option Message-ID: <20060301221233.GV82012@pervasive.com> References: <20060301134902.GB4800@surnet.cl> <20060301150016.GA6350@surnet.cl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060301150016.GA6350@surnet.cl> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060301:akhilesh.davim@gmail.com::nCQZd/SjhrcW/Z7/:0000000000000 0000000000000000000000000r3b X-Hashcash: 1:20:060301:pgsql-general@postgresql.org::38vGEfuw7Oa56eMd:000000000 00000000000000000000000002Co X-Hashcash: 1:20:060301:pgsql-sql@postgresql.org::2mkL2IyqXnQd0iBF:0000000000000 0000000000000000000000000DOB X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200603/35 X-Sequence-Number: 91900 Though, it is pretty easy to do something like: select 'GRANT ALL ON ' || table_name || ' TO public;' from information_schema.tables where table_schema='blah'; You can feed the output of that to psql, ei: psql -qc "select 'GRANT ALL ON ' || table_name || ' TO public;' from information_schema.tables where table_schema='blah'" | psql On Wed, Mar 01, 2006 at 12:00:16PM -0300, Alvaro Herrera wrote: > AKHILESH GUPTA wrote: > > thank you very much sir for your valuable suggestion, > > but i am talking about direct database query...........! > > There is none that can help you here, short of making a function in > PL/pgSQL or other language ... > > > On 3/1/06, Alvaro Herrera wrote: > > > > > > AKHILESH GUPTA wrote: > > > > > > > here i have to grant permissions to that user individually for each and > > > > every table by using: > > > > :->> grant ALL ON to ; > > > > GRANT > > > > and all the permissions are granted to that user for that particular > > > table. > > > > > > Yes. If you are annoyed by having to type too many commands, you can > > > write a little shell script to do it for you. > > -- > Alvaro Herrera http://www.CommandPrompt.com/ > The PostgreSQL Company - Command Prompt, Inc. > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461