*** ./src/backend/access/common/printtup.c.orig	Tue Feb 19 13:06:01 2002
--- ./src/backend/access/common/printtup.c	Tue Feb 19 20:26:35 2002
***************
*** 268,274 ****
   * ----------------
   */
  void
! showatts(char *name, TupleDesc tupleDesc)
  {
  	int			i;
  	int			natts = tupleDesc->natts;
--- 268,274 ----
   * ----------------
   */
  void
! showatts(const char *name, TupleDesc tupleDesc)
  {
  	int			i;
  	int			natts = tupleDesc->natts;
*** ./src/backend/commands/command.c.orig	Tue Feb 19 12:56:25 2002
--- ./src/backend/commands/command.c	Tue Feb 19 20:26:35 2002
***************
*** 11,17 ****
   *	  $Header: /projects/cvsroot/pgsql/src/backend/commands/command.c,v 1.153 2002/02/14 15:24:06 tgl Exp $
   *
   * NOTES
!  *	  The PerformAddAttribute() code, like most of the relation
   *	  manipulating code in the commands/ directory, should go
   *	  someplace closer to the lib/catalog code.
   *
--- 11,17 ----
   *	  $Header: /projects/cvsroot/pgsql/src/backend/commands/command.c,v 1.153 2002/02/14 15:24:06 tgl Exp $
   *
   * NOTES
!  *	  The AlterTableAddColumn() code, like most of the relation
   *	  manipulating code in the commands/ directory, should go
   *	  someplace closer to the lib/catalog code.
   *
***************
*** 93,102 ****
   * --------------------------------
   */
  void
! PerformPortalFetch(char *name,
  				   bool forward,
  				   int count,
! 				   char *tag,
  				   CommandDest dest)
  {
  	Portal		portal;
--- 93,102 ----
   * --------------------------------
   */
  void
! PerformPortalFetch(const char *name,
  				   bool forward,
  				   int count,
! 				   const char *tag,
  				   CommandDest dest)
  {
  	Portal		portal;
***************
*** 247,253 ****
   * --------------------------------
   */
  void
! PerformPortalClose(char *name, CommandDest dest)
  {
  	Portal		portal;
  
--- 247,253 ----
   * --------------------------------
   */
  void
! PerformPortalClose(const char *name)
  {
  	Portal		portal;
  
*** ./src/backend/commands/rename.c.orig	Tue Feb 19 13:58:54 2002
--- ./src/backend/commands/rename.c	Tue Feb 19 20:26:35 2002
***************
*** 127,151 ****
  		foreach(child, children)
  		{
  			Oid			childrelid = lfirsti(child);
- 			char		childname[NAMEDATALEN];
  
  			if (childrelid == relid)
  				continue;
! 			reltup = SearchSysCache(RELOID,
! 									ObjectIdGetDatum(childrelid),
! 									0, 0, 0);
  			if (!HeapTupleIsValid(reltup))
  			{
  				elog(ERROR, "renameatt: can't find catalog entry for inheriting class with oid %u",
  					 childrelid);
  			}
- 			/* make copy of cache value, could disappear in call */
- 			StrNCpy(childname,
- 					NameStr(((Form_pg_class) GETSTRUCT(reltup))->relname),
- 					NAMEDATALEN);
- 			ReleaseSysCache(reltup);
  			/* note we need not recurse again! */
! 			renameatt(childname, oldattname, newattname, 0);
  		}
  	}
  
--- 127,147 ----
  		foreach(child, children)
  		{
  			Oid			childrelid = lfirsti(child);
  
  			if (childrelid == relid)
  				continue;
! 			reltup = SearchSysCacheCopy(RELOID,
! 										ObjectIdGetDatum(childrelid),
! 										0, 0, 0);
  			if (!HeapTupleIsValid(reltup))
  			{
  				elog(ERROR, "renameatt: can't find catalog entry for inheriting class with oid %u",
  					 childrelid);
  			}
  			/* note we need not recurse again! */
! 			renameatt(NameStr(((Form_pg_class) GETSTRUCT(reltup))->relname),
! 					  oldattname, newattname, 0);
! 			heap_freetuple(reltup);
  		}
  	}
  
***************
*** 501,506 ****
--- 497,503 ----
  			ReleaseBuffer(buffer);
  			continue;
  		}
+ 
  		argp = (const char *) VARDATA(val);
  		for (i = 0; i < tgnargs; i++)
  		{
***************
*** 550,558 ****
  			continue;
  		}
  
! 		/*
! 		 * Construct modified tgargs bytea.
! 		 */
  		newlen = VARHDRSZ;
  		for (i = 0; i < tgnargs; i++)
  			newlen += strlen(arga[i]) + 1;
--- 547,553 ----
  			continue;
  		}
  
! 		/* Construct modified tgargs bytea. */
  		newlen = VARHDRSZ;
  		for (i = 0; i < tgnargs; i++)
  			newlen += strlen(arga[i]) + 1;
***************
*** 565,573 ****
  			newlen += strlen(arga[i]) + 1;
  		}
  
! 		/*
! 		 * Build modified tuple.
! 		 */
  		for (i = 0; i < Natts_pg_trigger; i++)
  		{
  			values[i] = (Datum) 0;
--- 560,566 ----
  			newlen += strlen(arga[i]) + 1;
  		}
  
! 		/* Build modified tuple. */
  		for (i = 0; i < Natts_pg_trigger; i++)
  		{
  			values[i] = (Datum) 0;
***************
*** 579,592 ****
  
  		tuple = heap_modifytuple(tuple, tgrel, values, nulls, replaces);
  
! 		/*
! 		 * Now we can release hold on original tuple.
! 		 */
  		ReleaseBuffer(buffer);
  
! 		/*
! 		 * Update pg_trigger and its indexes
! 		 */
  		simple_heap_update(tgrel, &tuple->t_self, tuple);
  
  		{
--- 572,581 ----
  
  		tuple = heap_modifytuple(tuple, tgrel, values, nulls, replaces);
  
! 		/* Now we can release hold on original tuple. */
  		ReleaseBuffer(buffer);
  
! 		/* Update pg_trigger and its indexes. */
  		simple_heap_update(tgrel, &tuple->t_self, tuple);
  
  		{
*** ./src/backend/tcop/dest.c.orig	Tue Feb 19 13:03:46 2002
--- ./src/backend/tcop/dest.c	Tue Feb 19 20:27:19 2002
***************
*** 81,92 ****
   * ----------------
   */
  void
! BeginCommand(char *pname,
  			 int operation,
  			 TupleDesc tupdesc,
  			 bool isIntoRel,
  			 bool isIntoPortal,
- 			 char *tag,
  			 CommandDest dest)
  {
  	Form_pg_attribute *attrs = tupdesc->attrs;
--- 81,91 ----
   * ----------------
   */
  void
! BeginCommand(const char *pname,
  			 int operation,
  			 TupleDesc tupdesc,
  			 bool isIntoRel,
  			 bool isIntoPortal,
  			 CommandDest dest)
  {
  	Form_pg_attribute *attrs = tupdesc->attrs;
*** ./src/backend/utils/mmgr/portalmem.c.orig	Tue Feb 19 12:59:07 2002
--- ./src/backend/utils/mmgr/portalmem.c	Tue Feb 19 20:26:35 2002
***************
*** 134,140 ****
   *		Returns a portal given a portal name, or NULL if name not found.
   */
  Portal
! GetPortalByName(char *name)
  {
  	Portal		portal;
  
--- 134,140 ----
   *		Returns a portal given a portal name, or NULL if name not found.
   */
  Portal
! GetPortalByName(const char *name)
  {
  	Portal		portal;
  
***************
*** 185,191 ****
   *		"NOTICE" if portal name is in use (existing portal is returned!)
   */
  Portal
! CreatePortal(char *name)
  {
  	Portal		portal;
  
--- 185,191 ----
   *		"NOTICE" if portal name is in use (existing portal is returned!)
   */
  Portal
! CreatePortal(const char *name)
  {
  	Portal		portal;
  
*** ./src/include/access/printtup.h.orig	Tue Feb 19 13:06:38 2002
--- ./src/include/access/printtup.h	Tue Feb 19 20:26:35 2002
***************
*** 18,24 ****
  
  extern DestReceiver *printtup_create_DR(bool isBinary);
  
! extern void showatts(char *name, TupleDesc attinfo);
  extern void debugtup(HeapTuple tuple, TupleDesc typeinfo,
  		 DestReceiver *self);
  
--- 18,24 ----
  
  extern DestReceiver *printtup_create_DR(bool isBinary);
  
! extern void showatts(const char *name, TupleDesc attinfo);
  extern void debugtup(HeapTuple tuple, TupleDesc typeinfo,
  		 DestReceiver *self);
  
*** ./src/include/commands/command.h.orig	Tue Feb 19 12:57:43 2002
--- ./src/include/commands/command.h	Tue Feb 19 20:26:35 2002
***************
*** 26,39 ****
   *		BadArg if forward invalid.
   *		"ERROR" if portal not found.
   */
! extern void PerformPortalFetch(char *name, bool forward, int count,
! 				   char *tag, CommandDest dest);
  
  /*
   * PerformPortalClose
   *		Performs the POSTQUEL function CLOSE.
   */
! extern void PerformPortalClose(char *name, CommandDest dest);
  
  extern void PortalCleanup(Portal portal);
  
--- 26,39 ----
   *		BadArg if forward invalid.
   *		"ERROR" if portal not found.
   */
! extern void PerformPortalFetch(const char *name, bool forward, int count,
! 				   const char *tag, CommandDest dest);
  
  /*
   * PerformPortalClose
   *		Performs the POSTQUEL function CLOSE.
   */
! extern void PerformPortalClose(const char *name);
  
  extern void PortalCleanup(Portal portal);
  
*** ./src/include/commands/rename.h.orig	Tue Feb 19 13:13:14 2002
--- ./src/include/commands/rename.h	Tue Feb 19 20:26:35 2002
***************
*** 14,22 ****
  #ifndef RENAME_H
  #define RENAME_H
  
! extern void renameatt(char *relname,
! 		  char *oldattname,
! 		  char *newattname,
  		  int recurse);
  
  extern void renamerel(const char *oldrelname,
--- 14,22 ----
  #ifndef RENAME_H
  #define RENAME_H
  
! extern void renameatt(const char *relname,
! 		  const char *oldattname,
! 		  const char *newattname,
  		  int recurse);
  
  extern void renamerel(const char *oldrelname,
*** ./src/include/tcop/dest.h.orig	Tue Feb 19 13:04:43 2002
--- ./src/include/tcop/dest.h	Tue Feb 19 20:27:42 2002
***************
*** 84,92 ****
  
  /* The primary destination management functions */
  
! extern void BeginCommand(char *pname, int operation, TupleDesc attinfo,
! 			 bool isIntoRel, bool isIntoPortal, char *tag,
! 			 CommandDest dest);
  extern DestReceiver *DestToFunction(CommandDest dest);
  extern void EndCommand(char *commandTag, CommandDest dest);
  
--- 84,91 ----
  
  /* The primary destination management functions */
  
! extern void BeginCommand(const char *pname, int operation, TupleDesc tupdesc,
! 			 bool isIntoRel, bool isIntoPortal, CommandDest dest);
  extern DestReceiver *DestToFunction(CommandDest dest);
  extern void EndCommand(char *commandTag, CommandDest dest);
  
