Skip site navigation (1) Skip section navigation (2)

Anonymous code blocks (was: Re: GRANT ON ALL IN schema)

From: Petr Jelinek <pjmodos(at)pjmodos(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Anonymous code blocks (was: Re: GRANT ON ALL IN schema)
Date: 2009-08-28 23:39:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> The question is still valid, though it's better put in your words - do 
> we want to refactor the existing compiler or write a separate one ?

So, for now I went with the path of custom compiler and current executor.

I attached current version of the patch. I don't expect this to get
committed or anything, but I'd like other eyes to take a look at it.

What it does:
Adds laninline Oid which points to function handling inline code (aka
anonymous code block).
Adds DO $$some code$$ [ LANGUAGE lanname ] syntax which sends the source
code to that laninline function of the specified language (or language
set by default_do_language guc).
There is implementation for plpgsql with simpler compiler which still
creates function struct for the executor (I believe there is no harm in
adjusting executor later, when current one works, just does unnecessary
There is doc and a simple regression test for plpgsql implementation.

Petr Jelinek (PJMODOS)

Attachment: inlinepl-2009-08-28.diff.gz
Description: application/x-tar (9.0 KB)

In response to


pgsql-hackers by date

Next:From: Ron MayerDate: 2009-08-29 00:03:00
Subject: Re: Add YAML option to explain
Previous:From: Andrew DunstanDate: 2009-08-28 23:37:58
Subject: Re: Linux LSB init script

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group