mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Apply the core parts of Dennis Bjorklund's patch to allow function
parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.274 2004/01/06 04:31:01 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.275 2004/01/06 23:55:18 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1878,7 +1878,7 @@ _copyCreateFunctionStmt(CreateFunctionStmt *from)
|
||||
|
||||
COPY_SCALAR_FIELD(replace);
|
||||
COPY_NODE_FIELD(funcname);
|
||||
COPY_NODE_FIELD(argTypes);
|
||||
COPY_NODE_FIELD(parameters);
|
||||
COPY_NODE_FIELD(returnType);
|
||||
COPY_NODE_FIELD(options);
|
||||
COPY_NODE_FIELD(withClause);
|
||||
@@ -1886,6 +1886,17 @@ _copyCreateFunctionStmt(CreateFunctionStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static FunctionParameter *
|
||||
_copyFunctionParameter(FunctionParameter *from)
|
||||
{
|
||||
FunctionParameter *newnode = makeNode(FunctionParameter);
|
||||
|
||||
COPY_STRING_FIELD(name);
|
||||
COPY_NODE_FIELD(argType);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static RemoveAggrStmt *
|
||||
_copyRemoveAggrStmt(RemoveAggrStmt *from)
|
||||
{
|
||||
@@ -2788,6 +2799,9 @@ copyObject(void *from)
|
||||
case T_CreateFunctionStmt:
|
||||
retval = _copyCreateFunctionStmt(from);
|
||||
break;
|
||||
case T_FunctionParameter:
|
||||
retval = _copyFunctionParameter(from);
|
||||
break;
|
||||
case T_RemoveAggrStmt:
|
||||
retval = _copyRemoveAggrStmt(from);
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.212 2004/01/05 05:07:35 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.213 2004/01/06 23:55:18 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -884,7 +884,7 @@ _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(replace);
|
||||
COMPARE_NODE_FIELD(funcname);
|
||||
COMPARE_NODE_FIELD(argTypes);
|
||||
COMPARE_NODE_FIELD(parameters);
|
||||
COMPARE_NODE_FIELD(returnType);
|
||||
COMPARE_NODE_FIELD(options);
|
||||
COMPARE_NODE_FIELD(withClause);
|
||||
@@ -892,6 +892,15 @@ _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
|
||||
{
|
||||
COMPARE_STRING_FIELD(name);
|
||||
COMPARE_NODE_FIELD(argType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalRemoveAggrStmt(RemoveAggrStmt *a, RemoveAggrStmt *b)
|
||||
{
|
||||
@@ -1868,6 +1877,9 @@ equal(void *a, void *b)
|
||||
case T_CreateFunctionStmt:
|
||||
retval = _equalCreateFunctionStmt(a, b);
|
||||
break;
|
||||
case T_FunctionParameter:
|
||||
retval = _equalFunctionParameter(a, b);
|
||||
break;
|
||||
case T_RemoveAggrStmt:
|
||||
retval = _equalRemoveAggrStmt(a, b);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user