Clean up leftover bugs from recent COPY feature patch --- missed
authorTom Lane
Mon, 19 Aug 2002 00:40:15 +0000 (00:40 +0000)
committerTom Lane
Mon, 19 Aug 2002 00:40:15 +0000 (00:40 +0000)
required changes to copyfuncs/equalfuncs.

src/backend/commands/copy.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/include/nodes/parsenodes.h

index 890ef6f6768d8db0da53cdc431c46d62f2ad2073..afe08a74a697639ddf095b8d64eda12810fe7734 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.163 2002/08/15 16:36:02 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.164 2002/08/19 00:40:14 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1513,7 +1513,7 @@ CopyGetAttnums(Relation rel, List *attnamelist)
 
        foreach(l, attnamelist)
        {
-           char       *name = strVal(lfirst(l));
+           char       *name = ((Ident *) lfirst(l))->name;
            int         attnum;
 
            /* Lookup column name, elog on failure */
index a989d7006429a65fcaf57a0f3da65847d5e300b7..59bc689523511359fab2c95d3836d3bb59383bb4 100644 (file)
@@ -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.202 2002/08/19 00:11:53 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.203 2002/08/19 00:40:14 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2016,6 +2016,7 @@ _copyCopyStmt(CopyStmt *from)
    CopyStmt   *newnode = makeNode(CopyStmt);
 
    Node_Copy(from, newnode, relation);
+   Node_Copy(from, newnode, attlist);
    newnode->is_from = from->is_from;
    if (from->filename)
        newnode->filename = pstrdup(from->filename);
index ae79501ae4cae98555f66dbd2609518eafe62935..60b6d2d3b160a6ed5cef52419af35366a2db64fa 100644 (file)
@@ -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.151 2002/08/19 00:11:53 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.152 2002/08/19 00:40:14 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -801,6 +801,8 @@ _equalCopyStmt(CopyStmt *a, CopyStmt *b)
 {
    if (!equal(a->relation, b->relation))
        return false;
+   if (!equal(a->attlist, b->attlist))
+       return false;
    if (a->is_from != b->is_from)
        return false;
    if (!equalstr(a->filename, b->filename))
index 8c356a55976350f9ddaed13d2fdb58789f2dcc89..14d4126bbed9d4ceea06826933d1b5ea068df167 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: parsenodes.h,v 1.199 2002/08/15 16:36:07 momjian Exp $
+ * $Id: parsenodes.h,v 1.200 2002/08/19 00:40:15 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -869,7 +869,7 @@ typedef struct CopyStmt
 {
    NodeTag     type;
    RangeVar   *relation;       /* the relation to copy */
-   List *attlist;
+   List       *attlist;        /* List of Ident nodes, or NIL for all */
    bool        is_from;        /* TO or FROM */
    char       *filename;       /* if NULL, use stdin/stdout */
    List       *options;        /* List of DefElem nodes */