*** src/backend/parser/parse_type.c.orig	Tue May 30 00:24:49 2000
--- src/backend/parser/parse_type.c	Tue Jun  6 11:41:08 2000
***************
*** 48,54 ****
  		return NULL;
  	}
  	typetuple = (Form_pg_type) GETSTRUCT(tup);
! 	return NameStr(typetuple->typname);
  }
  
  /* return a Type structure, given a type id */
--- 48,55 ----
  		return NULL;
  	}
  	typetuple = (Form_pg_type) GETSTRUCT(tup);
! 	/* pstrdup here because result may need to outlive the syscache entry */
! 	return pstrdup(NameStr(typetuple->typname));
  }
  
  /* return a Type structure, given a type id */
***************
*** 119,125 ****
  	Form_pg_type typ;
  
  	typ = (Form_pg_type) GETSTRUCT(t);
! 	return NameStr(typ->typname);
  }
  
  /* given a type, return its typetype ('c' for 'c'atalog types) */
--- 120,127 ----
  	Form_pg_type typ;
  
  	typ = (Form_pg_type) GETSTRUCT(t);
! 	/* pstrdup here because result may need to outlive the syscache entry */
! 	return pstrdup(NameStr(typ->typname));
  }
  
  /* given a type, return its typetype ('c' for 'c'atalog types) */

*** src/backend/utils/cache/fcache.c~	Wed Apr 12 13:15:53 2000
--- src/backend/utils/cache/fcache.c	Tue Jun  6 13:39:03 2000
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/heapam.h"
  #include "catalog/pg_language.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
***************
*** 89,97 ****
  	if (!use_syscache)
  		elog(ERROR, "what the ????, init the fcache without the catalogs?");
  
! 	procedureTuple = SearchSysCacheTuple(PROCOID,
! 										 ObjectIdGetDatum(foid),
! 										 0, 0, 0);
  
  	if (!HeapTupleIsValid(procedureTuple))
  		elog(ERROR, "init_fcache: Cache lookup failed for procedure %u",
--- 90,98 ----
  	if (!use_syscache)
  		elog(ERROR, "what the ????, init the fcache without the catalogs?");
  
! 	procedureTuple = SearchSysCacheTupleCopy(PROCOID,
! 											 ObjectIdGetDatum(foid),
! 											 0, 0, 0);
  
  	if (!HeapTupleIsValid(procedureTuple))
  		elog(ERROR, "init_fcache: Cache lookup failed for procedure %u",
***************
*** 258,263 ****
--- 259,266 ----
  	}
  	else
  		retval->func.fn_addr = (func_ptr) NULL;
+ 
+ 	heap_freetuple(procedureTuple);
  
  	return retval;
  }
