From: Pavel Stehule <pavel.stehule@gmail.com>
To: Dimitri Fontaine <dfontaine@hi-media.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org, Nikhil Sontakke <nikhil.sontakke@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Petr Jelinek <pjmodos@pjmodos.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: GRANT ON ALL IN schema
Date: Sat, 15 Aug 2009 13:34:40 +0200
Message-ID: <162867790908150434j7aef36ecm202e81c4bb4740fa@mail.gmail.com> (raw)
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>
2009/8/15 Dimitri Fontaine <dfontaine@hi-media.com>:
> Hi,
>
> Le 10 août 09 à 17:19, Andrew Dunstan a écrit :
>>
>> 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 files
> 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 simplify
> the support code.
>
> DO $$
> IF postgresql_major_version = '8.2'
> THEN
> ...
>
> ELSE
> ...
>
> END 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 >= 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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pavel.stehule@gmail.com, dfontaine@hi-media.com, andrew@dunslane.net, Kevin.Grittner@wicourts.gov, peter_e@gmx.net, nikhil.sontakke@enterprisedb.com, robertmhaas@gmail.com, pjmodos@pjmodos.net, sfrost@snowman.net, tgl@sss.pgh.pa.us
Subject: Re: GRANT ON ALL IN schema
In-Reply-To: <162867790908150434j7aef36ecm202e81c4bb4740fa@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox