Commit 0fc13f58 authored by Bruce Momjian's avatar Bruce Momjian

Make sure resdomno for update/insert match attribute number for

rewrite system.  Restructure parse_target to make it easier to
understand.
parent a06ba33c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.23 1998/08/05 04:49:09 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.24 1998/08/25 03:17:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -272,14 +272,14 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause) ...@@ -272,14 +272,14 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause)
switch(nodeTag(node)) switch(nodeTag(node))
{ {
case T_Attr: case T_Attr:
target_result = transformTargetIdent(pstate, node, makeNode(TargetEntry), target_result = MakeTargetEntryIdent(pstate, node,
&((Attr*)node)->relname, NULL, &((Attr*)node)->relname, NULL,
((Attr*)node)->relname, TRUE); ((Attr*)node)->relname, TRUE);
lappend(tlist, target_result); lappend(tlist, target_result);
break; break;
case T_Ident: case T_Ident:
target_result = transformTargetIdent(pstate, node, makeNode(TargetEntry), target_result = MakeTargetEntryIdent(pstate, node,
&((Ident*)node)->name, NULL, &((Ident*)node)->name, NULL,
((Ident*)node)->name, TRUE); ((Ident*)node)->name, TRUE);
lappend(tlist, target_result); lappend(tlist, target_result);
...@@ -294,7 +294,7 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause) ...@@ -294,7 +294,7 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause)
case T_FuncCall: case T_FuncCall:
case T_A_Expr: case T_A_Expr:
target_result = MakeTargetlistExpr(pstate, "resjunk", expr, FALSE, TRUE); target_result = MakeTargetEntryExpr(pstate, "resjunk", expr, FALSE, TRUE);
lappend(tlist, target_result); lappend(tlist, target_result);
break; break;
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: parse_target.h,v 1.9 1998/08/05 04:49:15 scrappy Exp $ * $Id: parse_target.h,v 1.10 1998/08/25 03:17:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -25,9 +25,8 @@ ...@@ -25,9 +25,8 @@
extern List *transformTargetList(ParseState *pstate, List *targetlist); extern List *transformTargetList(ParseState *pstate, List *targetlist);
extern List *makeTargetNames(ParseState *pstate, List *cols); extern List *makeTargetNames(ParseState *pstate, List *cols);
extern TargetEntry * extern TargetEntry *
transformTargetIdent(ParseState *pstate, MakeTargetEntryIdent(ParseState *pstate,
Node *node, Node *node,
TargetEntry *tent,
char **resname, char **resname,
char *refname, char *refname,
char *colname, char *colname,
...@@ -35,7 +34,7 @@ transformTargetIdent(ParseState *pstate, ...@@ -35,7 +34,7 @@ transformTargetIdent(ParseState *pstate,
extern Node * extern Node *
CoerceTargetExpr(ParseState *pstate, Node *expr, CoerceTargetExpr(ParseState *pstate, Node *expr,
Oid type_id, Oid attrtype); Oid type_id, Oid attrtype);
TargetEntry * MakeTargetlistExpr(ParseState *pstate, TargetEntry * MakeTargetEntryExpr(ParseState *pstate,
char *colname, char *colname,
Node *expr, Node *expr,
List *arrayRef, List *arrayRef,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment