OSDN Git Service

First phase of applying Rod Taylor's pg_depend patch. This just adds
[pg-rex/syncrep.git] / src / backend / nodes / copyfuncs.c
index 3801d40..739161b 100644 (file)
  * different executor state node types.
  *
  *
- * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.184 2002/05/12 23:43:02 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.192 2002/07/01 15:27:51 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1992,16 +1992,11 @@ _copyCopyStmt(CopyStmt *from)
 {
        CopyStmt   *newnode = makeNode(CopyStmt);
 
-       newnode->binary = from->binary;
        Node_Copy(from, newnode, relation);
-       newnode->oids = from->oids;
-       newnode->direction = from->direction;
+       newnode->is_from = from->is_from;
        if (from->filename)
                newnode->filename = pstrdup(from->filename);
-       if (from->delimiter)
-               newnode->delimiter = pstrdup(from->delimiter);
-       if (from->null_print)
-               newnode->null_print = pstrdup(from->null_print);
+       Node_Copy(from, newnode, options);
 
        return newnode;
 }
@@ -2098,18 +2093,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;
 }
@@ -2121,6 +2115,7 @@ _copyRemoveAggrStmt(RemoveAggrStmt *from)
 
        Node_Copy(from, newnode, aggname);
        Node_Copy(from, newnode, aggtype);
+       newnode->behavior = from->behavior;
 
        return newnode;
 }
@@ -2132,6 +2127,7 @@ _copyRemoveFuncStmt(RemoveFuncStmt *from)
 
        Node_Copy(from, newnode, funcname);
        Node_Copy(from, newnode, args);
+       newnode->behavior = from->behavior;
 
        return newnode;
 }
@@ -2143,6 +2139,7 @@ _copyRemoveOperStmt(RemoveOperStmt *from)
 
        Node_Copy(from, newnode, opname);
        Node_Copy(from, newnode, args);
+       newnode->behavior = from->behavior;
 
        return newnode;
 }
@@ -2259,13 +2256,7 @@ _copyCreatedbStmt(CreatedbStmt *from)
 
        if (from->dbname)
                newnode->dbname = pstrdup(from->dbname);
-       if (from->dbowner)
-               newnode->dbowner = pstrdup(from->dbowner);
-       if (from->dbpath)
-               newnode->dbpath = pstrdup(from->dbpath);
-       if (from->dbtemplate)
-               newnode->dbtemplate = pstrdup(from->dbtemplate);
-       newnode->encoding = from->encoding;
+       Node_Copy(from, newnode, options);
 
        return newnode;
 }
@@ -2342,6 +2333,7 @@ _copyVariableSetStmt(VariableSetStmt *from)
        if (from->name)
                newnode->name = pstrdup(from->name);
        Node_Copy(from, newnode, args);
+       newnode->is_local = from->is_local;
 
        return newnode;
 }
@@ -2406,6 +2398,7 @@ _copyDropPropertyStmt(DropPropertyStmt *from)
        if (from->property)
                newnode->property = pstrdup(from->property);
        newnode->removeType = from->removeType;
+       newnode->behavior = from->behavior;
 
        return newnode;
 }
@@ -2418,6 +2411,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;
@@ -2432,6 +2426,7 @@ _copyDropPLangStmt(DropPLangStmt *from)
 
        if (from->plname)
                newnode->plname = pstrdup(from->plname);
+       newnode->behavior = from->behavior;
 
        return newnode;
 }
@@ -2468,7 +2463,7 @@ _copyAlterUserSetStmt(AlterUserSetStmt *from)
        if (from->user)
                newnode->user = pstrdup(from->user);
        if (from->variable)
-               newnode->user = pstrdup(from->variable);
+               newnode->variable = pstrdup(from->variable);
        Node_Copy(from, newnode, value);
 
        return newnode;
@@ -2864,8 +2859,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);