mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add optional "validator" function to languages that can validate the
function body (and other properties) as a function in the language is created. This generalizes ad hoc code that already existed for the built-in languages. The validation now happens after the pg_proc tuple of the new function is created, so it is possible to define recursive SQL functions. Add some regression test cases that cover bogus function definition attempts.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.187 2002/05/17 18:32:52 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.188 2002/05/22 17:20:58 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2418,6 +2418,7 @@ _copyCreatePLangStmt(CreatePLangStmt *from)
|
||||
if (from->plname)
|
||||
newnode->plname = pstrdup(from->plname);
|
||||
Node_Copy(from, newnode, plhandler);
|
||||
Node_Copy(from, newnode, plvalidator);
|
||||
if (from->plcompiler)
|
||||
newnode->plcompiler = pstrdup(from->plcompiler);
|
||||
newnode->pltrusted = from->pltrusted;
|
||||
|
Reference in New Issue
Block a user