Implement the DO statement to support execution of PL code without having

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 9048b73184b6852b71faf4481b75ab5850a9cd1b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-09-22T23:43:43Z
Releases: 9.0.0
Implement the DO statement to support execution of PL code without having
to create a function for it.

Procedural languages now have an additional entry point, namely a function
to execute an inline code block.  This seemed a better design than trying
to hide the transient-ness of the code from the PL.  As of this patch, only
plpgsql has an inline handler, but probably people will soon write handlers
for the other standard PLs.

In passing, remove the long-dead LANCOMPILER option of CREATE LANGUAGE.

Petr Jelinek

Files

PathChange+/−
doc/src/sgml/catalogs.sgml modified +19 −1
doc/src/sgml/config.sgml modified +16 −1
doc/src/sgml/keywords.sgml modified +9 −9
doc/src/sgml/ref/allfiles.sgml modified +2 −1
doc/src/sgml/ref/create_language.sgml modified +27 −5
doc/src/sgml/ref/do.sgml added +122 −0
doc/src/sgml/reference.sgml modified +2 −1
doc/src/sgml/xplang.sgml modified +28 −7
src/backend/catalog/pg_proc.c modified +10 −9
src/backend/commands/functioncmds.c modified +108 −1
src/backend/commands/proclang.c modified +75 −8
src/backend/nodes/copyfuncs.c modified +15 −1
src/backend/nodes/equalfuncs.c modified +13 −1
src/backend/parser/gram.y modified +50 −17
src/backend/tcop/utility.c modified +13 −1
src/backend/utils/misc/guc.c modified +12 −1
src/backend/utils/misc/postgresql.conf.sample modified +1 −0
src/bin/pg_dump/pg_dump.c modified +39 −2
src/bin/pg_dump/pg_dump.h modified +2 −1
src/bin/scripts/droplang.c modified +51 −9
src/include/catalog/catversion.h modified +2 −2
src/include/catalog/pg_language.h modified +9 −7
src/include/catalog/pg_pltemplate.h modified +13 −11
src/include/commands/defrem.h modified +2 −1
src/include/nodes/nodes.h modified +4 −2
src/include/nodes/parsenodes.h modified +21 −1
src/include/parser/kwlist.h modified +2 −2
src/include/utils/guc.h modified +3 −1
src/interfaces/ecpg/preproc/ecpg.trailer modified +2 −2
src/pl/plpgsql/src/pl_comp.c modified +183 −33
src/pl/plpgsql/src/pl_handler.c modified +52 −1
src/pl/plpgsql/src/plpgsql.h modified +3 −1
src/test/regress/expected/plpgsql.out modified +37 −0
src/test/regress/sql/plpgsql.sql modified +23 −0