diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-09-22 23:43:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-09-22 23:43:43 +0000 |
commit | 9048b73184b6852b71faf4481b75ab5850a9cd1b (patch) | |
tree | 445092b67a93cf16300f72e41f14d8ad3443188f /src/backend/tcop/utility.c | |
parent | d5a43ffde068d67409b494d812bd7e9f514db29c (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/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index c6fefccfc6f..0d2079fc0aa 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.313 2009/07/29 20:56:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.314 2009/09/22 23:43:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -840,6 +840,10 @@ ProcessUtility(Node *parsetree, } break; + case T_DoStmt: + ExecuteDoStmt((DoStmt *) parsetree); + break; + case T_CreatedbStmt: PreventTransactionChain(isTopLevel, "CREATE DATABASE"); createdb((CreatedbStmt *) parsetree); @@ -1761,6 +1765,10 @@ CreateCommandTag(Node *parsetree) } break; + case T_DoStmt: + tag = "DO"; + break; + case T_CreatedbStmt: tag = "CREATE DATABASE"; break; @@ -2276,6 +2284,10 @@ GetCommandLogLevel(Node *parsetree) lev = LOGSTMT_DDL; break; + case T_DoStmt: + lev = LOGSTMT_ALL; + break; + case T_CreatedbStmt: lev = LOGSTMT_DDL; break; |