Re: GRANT ON ALL IN schema - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: GRANT ON ALL IN schema
Date
Msg-id 2CCE9C1D-919D-45D5-BFC2-C7723C45064E@hi-media.com
Whole thread Raw
In response to Re: GRANT ON ALL IN schema  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: GRANT ON ALL IN schema  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
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;
$$;

(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



pgsql-hackers by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: Wisconsin benchmark
Next
From: Pavel Stehule
Date:
Subject: Re: GRANT ON ALL IN schema