Re: GRANT ON ALL IN schema

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Petr Jelinek <pjmodos(at)pjmodos(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: GRANT ON ALL IN schema
Date: 2009-08-15 11:34:40
Message-ID: 162867790908150434j7aef36ecm202e81c4bb4740fa@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/8/15 Dimitri Fontaine <dfontaine(at)hi-media(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-08-15 13:19:17 Re: GRANT ON ALL IN schema
Previous Message Dimitri Fontaine 2009-08-15 10:16:16 Re: GRANT ON ALL IN schema