mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
Extend syntax of CREATE FUNCTION to resemble SQL99.
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.186 2002/05/17 01:19:17 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.187 2002/05/17 18:32:52 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2098,18 +2098,17 @@ _copyIndexStmt(IndexStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static ProcedureStmt *
|
||||
_copyProcedureStmt(ProcedureStmt *from)
|
||||
static CreateFunctionStmt *
|
||||
_copyCreateFunctionStmt(CreateFunctionStmt *from)
|
||||
{
|
||||
ProcedureStmt *newnode = makeNode(ProcedureStmt);
|
||||
CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
|
||||
|
||||
newnode->replace = from->replace;
|
||||
Node_Copy(from, newnode, funcname);
|
||||
Node_Copy(from, newnode, argTypes);
|
||||
Node_Copy(from, newnode, returnType);
|
||||
Node_Copy(from, newnode, options);
|
||||
Node_Copy(from, newnode, withClause);
|
||||
Node_Copy(from, newnode, as);
|
||||
newnode->language = pstrdup(from->language);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
@@ -2865,8 +2864,8 @@ copyObject(void *from)
|
||||
case T_IndexStmt:
|
||||
retval = _copyIndexStmt(from);
|
||||
break;
|
||||
case T_ProcedureStmt:
|
||||
retval = _copyProcedureStmt(from);
|
||||
case T_CreateFunctionStmt:
|
||||
retval = _copyCreateFunctionStmt(from);
|
||||
break;
|
||||
case T_RemoveAggrStmt:
|
||||
retval = _copyRemoveAggrStmt(from);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.133 2002/05/17 01:19:17 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.134 2002/05/17 18:32:52 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -923,7 +923,7 @@ _equalIndexStmt(IndexStmt *a, IndexStmt *b)
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalProcedureStmt(ProcedureStmt *a, ProcedureStmt *b)
|
||||
_equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
|
||||
{
|
||||
if (a->replace != b->replace)
|
||||
return false;
|
||||
@@ -933,12 +933,10 @@ _equalProcedureStmt(ProcedureStmt *a, ProcedureStmt *b)
|
||||
return false;
|
||||
if (!equal(a->returnType, b->returnType))
|
||||
return false;
|
||||
if (!equal(a->options, b->options))
|
||||
return false;
|
||||
if (!equal(a->withClause, b->withClause))
|
||||
return false;
|
||||
if (!equal(a->as, b->as))
|
||||
return false;
|
||||
if (!equalstr(a->language, b->language))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2020,8 +2018,8 @@ equal(void *a, void *b)
|
||||
case T_IndexStmt:
|
||||
retval = _equalIndexStmt(a, b);
|
||||
break;
|
||||
case T_ProcedureStmt:
|
||||
retval = _equalProcedureStmt(a, b);
|
||||
case T_CreateFunctionStmt:
|
||||
retval = _equalCreateFunctionStmt(a, b);
|
||||
break;
|
||||
case T_RemoveAggrStmt:
|
||||
retval = _equalRemoveAggrStmt(a, b);
|
||||
|
Reference in New Issue
Block a user