Re: Inline PL/pgSQL - Mailing list pgsql-hackers

From Neil Conway
Subject Re: Inline PL/pgSQL
Date
Msg-id 42800230.40700@samurai.com
Whole thread Raw
In response to Re: Inline PL/pgSQL  (David Fetter <david@fetter.org>)
Responses Re: Inline PL/pgSQL
List pgsql-hackers
David Fetter wrote:
> EXECUTE IMMEDIATE $$
>     function body here
> $$
> LANGUAGE plfoo;

Seems like a lot of unnecessary syntax for something that would be 
manually used by a lot of DBAs. Also, this is unrelated to normal 
EXECUTE, or the EXECUTE IMMEDIATE defined by the standard, so I'm not 
sure it's a good idea to use similar syntax.

BTW, this is a little off-the-wall, but one interesting idea to help SQL 
and PL/foo integration would be to replace the bison grammar for SQL 
with a hand-written recursive descent parser. If written carefully, this 
would allow other procedural languages to "call into" the SQL parser 
from their own parsers when appropriate, and integrate the resulting 
parse nodes into their own parse tree. PL/PgSQL in HEAD does something a 
bit similar for syntax checking, but it's pretty ugly (we need to 
manually invoke raw_parser(), and then we throw away the result).

-Neil


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Inline PL/pgSQL
Next
From: "Joshua D. Drake"
Date:
Subject: Re: rendezvous