Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 48C1A633C9F for ; Sat, 15 Aug 2009 08:34:48 -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 55024-04 for ; Sat, 15 Aug 2009 11:34:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f200.google.com (mail-yw0-f200.google.com [209.85.211.200]) by mail.postgresql.org (Postfix) with ESMTP id AA354632663 for ; Sat, 15 Aug 2009 08:34:42 -0300 (ADT) Received: by ywh38 with SMTP id 38so2637631ywh.20 for ; Sat, 15 Aug 2009 04:34:40 -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=V82ZeZZZty8EV7P6T/sYfxE0ggYmQUZyXwrtBMAlzNI=; b=D8J/u5sLsfVzVHYV68l2urcXfEO00ABAzs5vXhHFxiepvKbW9PJkt28MkEO0onz6Eb 9UVd/1BqEJBQXa8uN2GUBHTyZCtZEtM70DDE65/RcWI99WzpScMejhj2cyMPG1SFcGtJ YJpY7VIm+Eic3KSTjqaAwu8aK5AQoVw+7yb6s= 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=g6XSTl7NFS+FX+U+fO3YOak1Xsruy6s8Tkyuv8IKRW9HoWc8docQxxcb05Vr1fbs71 TL3clXcKJEK1c7hizQpbZrVALoIvlwSAvTcALqJKNIocG4dqpdolGJI3TkuAA/KsEv0Q 4EAAq3/f1cvsHDt8VhUe1V6B1u5CiR2sjLJZ4= MIME-Version: 1.0 Received: by 10.150.198.2 with SMTP id v2mr2291877ybf.154.1250336080377; Sat, 15 Aug 2009 04:34:40 -0700 (PDT) In-Reply-To: <2CCE9C1D-919D-45D5-BFC2-C7723C45064E@hi-media.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> <2CCE9C1D-919D-45D5-BFC2-C7723C45064E@hi-media.com> Date: Sat, 15 Aug 2009 13:34:40 +0200 Message-ID: <162867790908150434j7aef36ecm202e81c4bb4740fa@mail.gmail.com> Subject: Re: GRANT ON ALL IN schema From: Pavel Stehule To: Dimitri Fontaine Cc: Andrew Dunstan , Kevin Grittner , Peter Eisentraut , pgsql-hackers@postgresql.org, Nikhil Sontakke , Robert Haas , Petr Jelinek , Stephen Frost , Tom Lane 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.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FB_WORD1_END_DOLLAR=0.001 X-Spam-Level: X-Archive-Number: 200908/1189 X-Sequence-Number: 143832 2009/8/15 Dimitri Fontaine : > Hi, > > Le 10 ao=C3=BBt 09 =C3=A0 17:19, Andrew Dunstan a =C3=A9crit : >> >> One fairly simple way would use a new SQL verb (say, DO) like this: >> >> DO $$ something in plfoo$ $ LANGUAGE plfoo; >> >> We could even default the langauge to plpgsql, for which you would then >> just need: >> >> DO $$ something in plpgsql $$; > > That would also be a nice feature to rely on in extensions install.sql fi= les > when you have major version dependant code. Defining a function, calling = it > then removing it is what to do now. This new syntax would greatly simplif= y > the support code. > > DO $$ > =C2=A0IF postgresql_major_version =3D '8.2' > =C2=A0THEN > =C2=A0 =C2=A0... > > =C2=A0ELSE > =C2=A0 =C2=A0... > > =C2=A0END IF; > $$; why we need DO statement? Why not just $$ $$. Only string literal cannot be statement too, so DO is unnecessary. it can look like: $$ FOR r IN SELECT .... END LOOP; $$; ??? > > (of course in this snippet example the ELSE covers it because the CREATE > EXTENSION stuff declared e.g. dependancy on postgresql >=3D 8.2). > > Regards, > -- > dim > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers >