Inline PL/pgSQL - Mailing list pgsql-hackers

From Jonah H. Harris
Subject Inline PL/pgSQL
Date
Msg-id 427FA177.8060407@tvi.edu
Whole thread Raw
In response to Re: Oracle Style packages on postgres  ("Jim C. Nasby" <decibel@decibel.org>)
Responses Re: Inline PL/pgSQL  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Inline PL/pgSQL  (Josh Berkus <josh@agliodbs.com>)
Re: Inline PL/pgSQL  (Hannu Krosing <hannu@tm.ee>)
Re: Inline PL/pgSQL  (David Fetter <david@fetter.org>)
List pgsql-hackers
Hey everyone,

In addition to package support in plpgsql, it would be really handy to 
have inline plpgsql.  Likewise, I think there are others who feel this 
way as-well.

Years ago, Oracle merged PL/SQL with their normal SQL parser which 
allowed for inline PL/SQL.  They did this because it was difficult to 
maintain two separate parsers.  While this worked great for Oracle, it 
probably wouldn't really work as well for PostgreSQL because pgsql 
supports multiple procedural languages.

As for implementation, I think it would obviously be best to leave 
plpgsql on its own as a PL but maybe change BEGIN and DECLARE in the 
normal parser and have the system generate/execute a function on the 
fly.  Or, maybe it would be better to integrate plpgsql.  Or, I may just 
be crazy.

Would anyone else ever benefit from inline functions?  Does anyone have 
any ideas about implementation?  Please shoot your opinions this way.  
Thanks.

-Jonah







pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: Oracle Style packages on postgres
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Inline PL/pgSQL