Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7FBB7633ABA for ; Thu, 18 Jun 2009 06:26:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18317-03 for ; Thu, 18 Jun 2009 06:26:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gauss.credativ.com (gauss.credativ.com [91.190.177.186]) by mail.postgresql.org (Postfix) with ESMTP id B09F5633A08 for ; Thu, 18 Jun 2009 06:26:05 -0300 (ADT) Received: from [172.26.14.137] (exit.credativ.com [87.139.82.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 31F339943C4; Thu, 18 Jun 2009 11:26:02 +0200 (CEST) Date: Thu, 18 Jun 2009 11:26:02 +0200 From: Bernd Helmle To: Peter Eisentraut , pgsql-hackers@postgresql.org cc: Petr Jelinek Subject: Re: GRANT ON ALL IN schema Message-ID: <968B9B6C6E5C937958E5456C@teje> In-Reply-To: <200906171644.53717.peter_e@gmx.net> References: <4A37BF63.50008@pjmodos.net> <4A37E122.8070303@pjmodos.net> <4A38A956.8080600@pjmodos.net> <200906171644.53717.peter_e@gmx.net> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/1106 X-Sequence-Number: 140161 --On Mittwoch, Juni 17, 2009 16:44:53 +0300 Peter Eisentraut wrote: > I think you should design this with a bit wider scope. Instead of just > "all tables in this schema", think "all tables satisfying some > condition". It has been requested, for example, to be able to grant on > all tables that match a pattern. > My experience shows that having such a thing is often leading to "bad practices". People tend to grant everything to every login role instead of using an intelligent role privilege mechanism. MySQL for example has such wildcards (using '_' and '%' wildcard patterns), which often confuses people when having such characters in their table/database names (of course, i forgot to escape them more than once). The unpredictable results of messing up a complete schema when using a broken pattern expression is going to reduce the usefulness of such a feature, i think. >> Also since this patch introduces VIEWS as object with grantable >> privileges, I added GRANT ON VIEW foo syntax which is more or less >> synonymous to GRANT ON TABLE foo syntax. It felt weird to have GRANT ON >> ALL VIEWS but not GRANT ON VIEW. > > As far as GRANT is concerned, a view is a table, so I would omit the > VIEW/VIEWS stuff completely. We have ALTER VIEW now, so why don't implement the same synonym for GRANT? -- Thanks Bernd