summaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-22 23:43:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-22 23:43:43 +0000
commit9048b73184b6852b71faf4481b75ab5850a9cd1b (patch)
tree445092b67a93cf16300f72e41f14d8ad3443188f /src/backend/nodes/copyfuncs.c
parentd5a43ffde068d67409b494d812bd7e9f514db29c (diff)
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
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 48039b86cb9..5feff5d1691 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.437 2009/07/30 02:45:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.438 2009/09/22 23:43:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2561,6 +2561,16 @@ _copyRemoveFuncStmt(RemoveFuncStmt *from)
return newnode;
}
+static DoStmt *
+_copyDoStmt(DoStmt *from)
+{
+ DoStmt *newnode = makeNode(DoStmt);
+
+ COPY_NODE_FIELD(args);
+
+ return newnode;
+}
+
static RemoveOpClassStmt *
_copyRemoveOpClassStmt(RemoveOpClassStmt *from)
{
@@ -3104,6 +3114,7 @@ _copyCreatePLangStmt(CreatePLangStmt *from)
COPY_STRING_FIELD(plname);
COPY_NODE_FIELD(plhandler);
+ COPY_NODE_FIELD(plinline);
COPY_NODE_FIELD(plvalidator);
COPY_SCALAR_FIELD(pltrusted);
@@ -3797,6 +3808,9 @@ copyObject(void *from)
case T_RemoveFuncStmt:
retval = _copyRemoveFuncStmt(from);
break;
+ case T_DoStmt:
+ retval = _copyDoStmt(from);
+ break;
case T_RemoveOpClassStmt:
retval = _copyRemoveOpClassStmt(from);
break;