pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: 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: Mon, 10 Aug 2009 11:19:37 -0400
Message-ID: <4A803A89.9020509@dunslane.net> (raw)
In-Reply-To: <4A7FE7F902000025000296E3@gw.wicourts.gov>
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>



Kevin Grittner wrote:
> Peter Eisentraut <peter_e@gmx.net> wrote: 
>  
>   
>> This would become much simpler if you could just execute plpgsql
>> code instead of having to define a function around it.
>>     
>  
> I have often wished for that feature.
>  
>   

You're not Robinson Crusoe.

It could be done in several ways.

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 $$;

The something would in effect be treated as a throwaway function taking 
no parameters and returning void.

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.

cheers

andrew



view thread (83+ messages)  latest in thread

Message-ID: <4A803A89.9020509@dunslane.net>
Permalink:  ../4A803A89.9020509@dunslane.net/
Also on:    postgresql.org/message-id/4A803A89.9020509@dunslane.net

 · 

reply

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: 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: <4A803A89.9020509@dunslane.net>

* 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