Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 03531633E88 for ; Mon, 10 Aug 2009 14:15:44 -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 13999-03 for ; Mon, 10 Aug 2009 17:15:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.210.180]) by mail.postgresql.org (Postfix) with ESMTP id 6BFC8633E74 for ; Mon, 10 Aug 2009 14:15:40 -0300 (ADT) Received: by yxe10 with SMTP id 10so3713412yxe.15 for ; Mon, 10 Aug 2009 10:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=w+bTGKKPpPzaoMtD/GELuoeo/G1E3OBxsicg9rF50NY=; b=TF39SHiCuuC9BjOJmSNgbJ8n932aeq+2XytFrGAbzPuE+Er/D/JYQ3GRv0PMV0+ZiI NFEmK6LB1elQsXW+QhT5CVTGMFetRISTFf3buJ2MddiyW9WRjYOZFO8iAeLVDjI7fDh9 C2nWy1bJJeHrPJZvWGhSl45V3D4om+Q/f2tXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=x0xbWmzEkVQlI8nv6BLzSN1d802u8+V8RZcmpwM4tHUjRjDzNbjWfUI2EV1vH6/1GL 5c+3gubOmP5Vl+ZcJwsn31yqhIBQwkn7kTnFvp6F+4SEWZttlTwwD0hpDwiURlgZMdxz I8UDtj5ful0WiWfBJ0srjWGZSsohlphuYAMvk= MIME-Version: 1.0 Received: by 10.151.156.14 with SMTP id i14mr8755064ybo.21.1249924539731; Mon, 10 Aug 2009 10:15:39 -0700 (PDT) In-Reply-To: <603c8f070908100909m69b876cdt1723f2fbd2462a40@mail.gmail.com> References: <4A37BF63.50008@pjmodos.net> <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <21246.1249491592@sss.pgh.pa.us> <200908101042.35024.peter_e@gmx.net> <4A7FE7F902000025000296E3@gw.wicourts.gov> <4A803A89.9020509@dunslane.net> <3285.1249918596@sss.pgh.pa.us> <603c8f070908100909m69b876cdt1723f2fbd2462a40@mail.gmail.com> Date: Mon, 10 Aug 2009 19:15:39 +0200 Message-ID: <162867790908101015l4ce4cc34n6ba03b5673511bc1@mail.gmail.com> Subject: Re: GRANT ON ALL IN schema From: Pavel Stehule To: Robert Haas Cc: Tom Lane , Andrew Dunstan , Kevin Grittner , Peter Eisentraut , pgsql-hackers@postgresql.org, Nikhil Sontakke , Petr Jelinek , Stephen Frost Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/812 X-Sequence-Number: 143455 2009/8/10 Robert Haas : > On Mon, Aug 10, 2009 at 11:36 AM, Tom Lane wrote: >> Andrew Dunstan writes: >>> One fairly simple way would use a new SQL verb (say, DO) like this: >> >>> DO $$ something in plfoo $$ LANGUAGE plfoo; >> >> Yeah, this has been suggested before. =C2=A0I can't see anything very wr= ong >> with it. >> >>> We could even default the langauge to plpgsql, for which you would then >>> just need: >> >>> DO $$ something in plpgsql $$; >> >> Add a GUC variable to set the default language, perhaps? >> >>> But to make it really nice you'd have to move away from pl programs as >>> strings. That would be a lot more work, and you really wouldn't want to >>> make it work with more than one PL for the sake of everyone's sanity. >> >> That would be an awful lot of messiness to save four keystrokes... > > I think it would be awfully handy to integrate some of the features of > PL/pgsql into core SQL - especially variables, and also things like IF > and FOR... =C2=A0but I'm not expecting it to happen any time soon, or may= be > ever. > SQL/PSM is better. This language is developed to integration to SQL. It allows one statement procedures. So IF .. THEN ELSE END IF; isn't correct code for PL/pgSQL and it is correct for SQL/PSM. so FOR r AS SELECT * FROM information_schema.tables DO GRANT .... ON r.table_name TO ...; END FOR; sql/psm doesn't need DECLARE, BEGIN and END in this case; http://www.postgres.cz/index.php/SQL/PSM_Manual regards Pavel Stehule > ...Robert > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers >