Index: src/backend/executor/execQual.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/executor/execQual.c,v
retrieving revision 1.226
diff -c -r1.226 execQual.c
*** src/backend/executor/execQual.c	1 Jan 2008 19:45:49 -0000	1.226
--- src/backend/executor/execQual.c	3 Apr 2008 12:25:22 -0000
***************
*** 450,456 ****
  {
  	Var		   *variable = (Var *) exprstate->expr;
  	TupleTableSlot *slot;
! 	AttrNumber	attnum;
  
  	if (isDone)
  		*isDone = ExprSingleResult;
--- 450,456 ----
  {
  	Var		   *variable = (Var *) exprstate->expr;
  	TupleTableSlot *slot;
! 	int			attnum;
  
  	if (isDone)
  		*isDone = ExprSingleResult;
***************
*** 637,643 ****
  {
  	Var		   *variable = (Var *) exprstate->expr;
  	TupleTableSlot *slot;
! 	AttrNumber	attnum;
  
  	if (isDone)
  		*isDone = ExprSingleResult;
--- 637,643 ----
  {
  	Var		   *variable = (Var *) exprstate->expr;
  	TupleTableSlot *slot;
! 	int			attnum;
  
  	if (isDone)
  		*isDone = ExprSingleResult;
Index: src/backend/nodes/makefuncs.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/nodes/makefuncs.c,v
retrieving revision 1.58
diff -c -r1.58 makefuncs.c
*** src/backend/nodes/makefuncs.c	1 Jan 2008 19:45:50 -0000	1.58
--- src/backend/nodes/makefuncs.c	3 Apr 2008 12:10:17 -0000
***************
*** 62,68 ****
   */
  Var *
  makeVar(Index varno,
! 		AttrNumber varattno,
  		Oid vartype,
  		int32 vartypmod,
  		Index varlevelsup)
--- 62,68 ----
   */
  Var *
  makeVar(Index varno,
! 		int varattno,
  		Oid vartype,
  		int32 vartypmod,
  		Index varlevelsup)
***************
*** 93,99 ****
   */
  TargetEntry *
  makeTargetEntry(Expr *expr,
! 				AttrNumber resno,
  				char *resname,
  				bool resjunk)
  {
--- 93,99 ----
   */
  TargetEntry *
  makeTargetEntry(Expr *expr,
! 				int resno,
  				char *resname,
  				bool resjunk)
  {
Index: src/backend/optimizer/util/var.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/optimizer/util/var.c,v
retrieving revision 1.73
diff -c -r1.73 var.c
*** src/backend/optimizer/util/var.c	1 Jan 2008 19:45:50 -0000	1.73
--- src/backend/optimizer/util/var.c	3 Apr 2008 12:22:41 -0000
***************
*** 595,608 ****
  			/* Must expand whole-row reference */
  			RowExpr    *rowexpr;
  			List	   *fields = NIL;
- 			AttrNumber	attnum;
  			ListCell   *l;
  
- 			attnum = 0;
  			foreach(l, rte->joinaliasvars)
  			{
  				newvar = (Node *) lfirst(l);
- 				attnum++;
  				/* Ignore dropped columns */
  				if (IsA(newvar, Const))
  					continue;
--- 595,605 ----
Index: src/backend/parser/parse_relation.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/parser/parse_relation.c,v
retrieving revision 1.130
diff -c -r1.130 parse_relation.c
*** src/backend/parser/parse_relation.c	1 Jan 2008 19:45:51 -0000	1.130
--- src/backend/parser/parse_relation.c	3 Apr 2008 12:10:25 -0000
***************
*** 1506,1512 ****
  		TargetEntry *te;
  
  		te = makeTargetEntry((Expr *) varnode,
! 							 (AttrNumber) pstate->p_next_resno++,
  							 label,
  							 false);
  		te_list = lappend(te_list, te);
--- 1506,1512 ----
  		TargetEntry *te;
  
  		te = makeTargetEntry((Expr *) varnode,
! 							 pstate->p_next_resno++,
  							 label,
  							 false);
  		te_list = lappend(te_list, te);
***************
*** 1529,1535 ****
   * occurs when a Var represents a whole tuple of a relation.
   */
  char *
! get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum)
  {
  	if (attnum == InvalidAttrNumber)
  		return "*";
--- 1529,1535 ----
   * occurs when a Var represents a whole tuple of a relation.
   */
  char *
! get_rte_attribute_name(RangeTblEntry *rte, int attnum)
  {
  	if (attnum == InvalidAttrNumber)
  		return "*";
***************
*** 1567,1573 ****
   *		Get attribute type information from a RangeTblEntry
   */
  void
! get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
  					   Oid *vartype, int32 *vartypmod)
  {
  	switch (rte->rtekind)
--- 1567,1573 ----
   *		Get attribute type information from a RangeTblEntry
   */
  void
! get_rte_attribute_type(RangeTblEntry *rte, int attnum,
  					   Oid *vartype, int32 *vartypmod)
  {
  	switch (rte->rtekind)
***************
*** 1710,1716 ****
   *		Check whether attempted attribute ref is to a dropped column
   */
  bool
! get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum)
  {
  	bool		result;
  
--- 1710,1716 ----
   *		Check whether attempted attribute ref is to a dropped column
   */
  bool
! get_rte_attribute_is_dropped(RangeTblEntry *rte, int attnum)
  {
  	bool		result;
  
Index: src/backend/parser/parse_target.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/parser/parse_target.c,v
retrieving revision 1.158
diff -c -r1.158 parse_target.c
*** src/backend/parser/parse_target.c	1 Jan 2008 19:45:51 -0000	1.158
--- src/backend/parser/parse_target.c	3 Apr 2008 12:13:47 -0000
***************
*** 83,89 ****
  	}
  
  	return makeTargetEntry((Expr *) expr,
! 						   (AttrNumber) pstate->p_next_resno++,
  						   colname,
  						   resjunk);
  }
--- 83,89 ----
  	}
  
  	return makeTargetEntry((Expr *) expr,
! 						   pstate->p_next_resno++,
  						   colname,
  						   resjunk);
  }
***************
*** 254,260 ****
  {
  	int			netlevelsup;
  	RangeTblEntry *rte;
! 	AttrNumber	attnum;
  
  	if (var == NULL || !IsA(var, Var))
  		return;
--- 254,260 ----
  {
  	int			netlevelsup;
  	RangeTblEntry *rte;
! 	int	attnum;
  
  	if (var == NULL || !IsA(var, Var))
  		return;
Index: src/backend/utils/adt/ruleutils.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/utils/adt/ruleutils.c,v
retrieving revision 1.269
diff -c -r1.269 ruleutils.c
*** src/backend/utils/adt/ruleutils.c	6 Jan 2008 01:03:16 -0000	1.269
--- src/backend/utils/adt/ruleutils.c	3 Apr 2008 12:16:10 -0000
***************
*** 2616,2622 ****
  {
  	StringInfo	buf = context->buf;
  	RangeTblEntry *rte;
! 	AttrNumber	attnum;
  	int			netlevelsup;
  	deparse_namespace *dpns;
  	char	   *schemaname;
--- 2616,2622 ----
  {
  	StringInfo	buf = context->buf;
  	RangeTblEntry *rte;
! 	int			attnum;
  	int			netlevelsup;
  	deparse_namespace *dpns;
  	char	   *schemaname;
***************
*** 2802,2808 ****
  					   int levelsup, deparse_context *context)
  {
  	RangeTblEntry *rte;
! 	AttrNumber	attnum;
  	int			netlevelsup;
  	deparse_namespace *dpns;
  	TupleDesc	tupleDesc;
--- 2802,2808 ----
  					   int levelsup, deparse_context *context)
  {
  	RangeTblEntry *rte;
! 	int			attnum;
  	int			netlevelsup;
  	deparse_namespace *dpns;
  	TupleDesc	tupleDesc;
***************
*** 4964,4970 ****
  {
  	StringInfo	buf = context->buf;
  	ListCell   *col;
! 	AttrNumber	attnum;
  	bool		first = true;
  
  	if (alias == NULL || alias->colnames == NIL)
--- 4964,4970 ----
  {
  	StringInfo	buf = context->buf;
  	ListCell   *col;
! 	int			attnum;
  	bool		first = true;
  
  	if (alias == NULL || alias->colnames == NIL)
Index: src/include/nodes/makefuncs.h
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/include/nodes/makefuncs.h,v
retrieving revision 1.61
diff -c -r1.61 makefuncs.h
*** src/include/nodes/makefuncs.h	1 Jan 2008 19:45:58 -0000	1.61
--- src/include/nodes/makefuncs.h	3 Apr 2008 12:10:57 -0000
***************
*** 24,36 ****
  				 Node *lexpr, Node *rexpr, int location);
  
  extern Var *makeVar(Index varno,
! 		AttrNumber varattno,
  		Oid vartype,
  		int32 vartypmod,
  		Index varlevelsup);
  
  extern TargetEntry *makeTargetEntry(Expr *expr,
! 				AttrNumber resno,
  				char *resname,
  				bool resjunk);
  
--- 24,36 ----
  				 Node *lexpr, Node *rexpr, int location);
  
  extern Var *makeVar(Index varno,
! 		int varattno,
  		Oid vartype,
  		int32 vartypmod,
  		Index varlevelsup);
  
  extern TargetEntry *makeTargetEntry(Expr *expr,
! 				int resno,
  				char *resname,
  				bool resjunk);
  
Index: src/include/nodes/primnodes.h
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/include/nodes/primnodes.h,v
retrieving revision 1.137
diff -c -r1.137 primnodes.h
*** src/include/nodes/primnodes.h	1 Jan 2008 19:45:58 -0000	1.137
--- src/include/nodes/primnodes.h	3 Apr 2008 12:10:06 -0000
***************
*** 134,140 ****
  	Expr		xpr;
  	Index		varno;			/* index of this var's relation in the range
  								 * table (could also be INNER or OUTER) */
! 	AttrNumber	varattno;		/* attribute number of this var, or zero for
  								 * all */
  	Oid			vartype;		/* pg_type OID for the type of this var */
  	int32		vartypmod;		/* pg_attribute typmod value */
--- 134,140 ----
  	Expr		xpr;
  	Index		varno;			/* index of this var's relation in the range
  								 * table (could also be INNER or OUTER) */
! 	int			varattno;		/* attribute number of this var, or zero for
  								 * all */
  	Oid			vartype;		/* pg_type OID for the type of this var */
  	int32		vartypmod;		/* pg_attribute typmod value */
***************
*** 145,151 ****
  	 * >0 means N levels up
  	 */
  	Index		varnoold;		/* original value of varno, for debugging */
! 	AttrNumber	varoattno;		/* original value of varattno */
  } Var;
  
  /*
--- 145,151 ----
  	 * >0 means N levels up
  	 */
  	Index		varnoold;		/* original value of varno, for debugging */
! 	int			varoattno;		/* original value of varattno */
  } Var;
  
  /*
***************
*** 497,503 ****
  {
  	Expr		xpr;
  	Expr	   *arg;			/* input expression */
! 	AttrNumber	fieldnum;		/* attribute number of field to extract */
  	Oid			resulttype;		/* type of the field (result type of this
  								 * node) */
  	int32		resulttypmod;	/* output typmod (usually -1) */
--- 497,503 ----
  {
  	Expr		xpr;
  	Expr	   *arg;			/* input expression */
! 	AttrNumber	fieldnum;		/* attribute number of field to extract */ /*XXX*/
  	Oid			resulttype;		/* type of the field (result type of this
  								 * node) */
  	int32		resulttypmod;	/* output typmod (usually -1) */
***************
*** 993,999 ****
  {
  	Expr		xpr;
  	Expr	   *expr;			/* expression to evaluate */
! 	AttrNumber	resno;			/* attribute number (see notes above) */
  	char	   *resname;		/* name of the column (could be NULL) */
  	Index		ressortgroupref;/* nonzero if referenced by a sort/group
  								 * clause */
--- 993,999 ----
  {
  	Expr		xpr;
  	Expr	   *expr;			/* expression to evaluate */
! 	int			resno;			/* attribute number (see notes above) */
  	char	   *resname;		/* name of the column (could be NULL) */
  	Index		ressortgroupref;/* nonzero if referenced by a sort/group
  								 * clause */
Index: src/include/parser/parsetree.h
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/include/parser/parsetree.h,v
retrieving revision 1.36
diff -c -r1.36 parsetree.h
*** src/include/parser/parsetree.h	1 Jan 2008 19:45:58 -0000	1.36
--- src/include/parser/parsetree.h	3 Apr 2008 09:36:49 -0000
***************
*** 45,57 ****
   * Given an RTE and an attribute number, return the appropriate
   * variable name or alias for that attribute of that RTE.
   */
! extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum);
  
  /*
   * Given an RTE and an attribute number, return the appropriate
   * type and typemod info for that attribute of that RTE.
   */
! extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
  					   Oid *vartype, int32 *vartypmod);
  
  /*
--- 45,57 ----
   * Given an RTE and an attribute number, return the appropriate
   * variable name or alias for that attribute of that RTE.
   */
! extern char *get_rte_attribute_name(RangeTblEntry *rte, int attnum);
  
  /*
   * Given an RTE and an attribute number, return the appropriate
   * type and typemod info for that attribute of that RTE.
   */
! extern void get_rte_attribute_type(RangeTblEntry *rte, int attnum,
  					   Oid *vartype, int32 *vartypmod);
  
  /*
***************
*** 59,65 ****
   * get_rte_attribute_type will fail on such an attr)
   */
  extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte,
! 							 AttrNumber attnum);
  
  
  /* ----------------
--- 59,65 ----
   * get_rte_attribute_type will fail on such an attr)
   */
  extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte,
! 							 int attnum);
  
  
  /* ----------------
