Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8EB98634CDC for ; Fri, 21 Aug 2009 11:27:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 45109-01 for ; Fri, 21 Aug 2009 14:26:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2E2D86339FC for ; Fri, 21 Aug 2009 11:27:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n7LEQoV7003494; Fri, 21 Aug 2009 10:26:51 -0400 (EDT) To: Alvaro Herrera cc: Petr Jelinek , PostgreSQL-development Subject: Re: GRANT ON ALL IN schema In-reply-to: <20090820190604.GK6261@alvh.no-ip.org> References: <4A86B5D5.6060807@dunslane.net> <4A871F46.1040002@agliodbs.com> <5D5ECAE0-F2B0-479B-9594-50AAF18F10ED@hi-media.com> <20090815223102.GS5407@samason.me.uk> <1250378139.18992.6.camel@vanquo.pezone.net> <603c8f070908152051mbd1d706hb0e29f5cfaf2f151@mail.gmail.com> <4A87854B.3070707@dunslane.net> <1250427428.26280.2.camel@vanquo.pezone.net> <395.1250439160@sss.pgh.pa.us> <4A8D9CA0.1040607@pjmodos.net> <20090820190604.GK6261@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Thu, 20 Aug 2009 15:06:04 -0400" Date: Fri, 21 Aug 2009 10:26:50 -0400 Message-ID: <3493.1250864810@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.593 tagged_above=-10 required=5 tests=AWL=0.006, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/1489 X-Sequence-Number: 144132 Alvaro Herrera writes: > Petr Jelinek wrote: >> The implementation as I see it would create function in pg_temp >> namespace, call it and then drop it. Any other implementation would >> imho mean rewriting procedure language api. > That's really ugly. It'll cause catalog bloat with every execution. > I think it would be acceptable to have a new column in pg_language that > pointed to an anonymous block execute function. Languages that do not > define this function cannot use this new feature. +1. The other way would also (presumably) mean invoking the language's validate procedure, which might well be redundant and in any case would probably not have exactly the error-reporting behavior one would want. I think it's better if the language knows it's dealing with an anonymous block. You could even imagine the language relaxing its rules a bit, for instance not requiring an outer BEGIN/END in plpgsql. regards, tom lane