*** ./src/backend/utils/adt/varlena.c.orig	Mon Jul 11 11:08:32 2005
--- ./src/backend/utils/adt/varlena.c	Mon Jul 11 11:10:45 2005
***************
*** 2064,2070 ****
  		{
  			text *append_text = text_substring(PointerGetDatum(replace_text),
  									  substr_start, ch_cnt, false);
! 			appendStringInfoString(str, PG_TEXT_GET_STR(append_text));
  			pfree(append_text);
  		}
  		substr_start += ch_cnt + 1;
--- 2064,2070 ----
  		{
  			text *append_text = text_substring(PointerGetDatum(replace_text),
  									  substr_start, ch_cnt, false);
! 			appendStringInfoText(str, append_text);
  			pfree(append_text);
  		}
  		substr_start += ch_cnt + 1;
***************
*** 2099,2105 ****
  			/* Copy the text that is back reference of regexp. */
  			text *append_text = text_substring(PointerGetDatum(src_text),
  									  so + 1, (eo - so), false);
! 			appendStringInfoString(str, PG_TEXT_GET_STR(append_text));
  			pfree(append_text);
  		}
  	}
--- 2099,2105 ----
  			/* Copy the text that is back reference of regexp. */
  			text *append_text = text_substring(PointerGetDatum(src_text),
  									  so + 1, (eo - so), false);
! 			appendStringInfoText(str, append_text);
  			pfree(append_text);
  		}
  	}
***************
*** 2169,2175 ****
  			text *left_text = text_substring(PointerGetDatum(src_text),
  									   data_pos + 1,
  									   pmatch[0].rm_so - data_pos, false);
! 			appendStringInfoString(str, PG_TEXT_GET_STR(left_text));
  			pfree(left_text);
  		}
  
--- 2169,2175 ----
  			text *left_text = text_substring(PointerGetDatum(src_text),
  									   data_pos + 1,
  									   pmatch[0].rm_so - data_pos, false);
! 			appendStringInfoText(str, left_text);
  			pfree(left_text);
  		}
  
***************
*** 2180,2186 ****
  		if (have_escape)
  			appendStringInfoRegexpSubstr(str, replace_text, pmatch, src_text);
  		else
! 			appendStringInfoString(str, PG_TEXT_GET_STR(replace_text));
  
  		search_start = data_pos = pmatch[0].rm_eo;
  
--- 2180,2186 ----
  		if (have_escape)
  			appendStringInfoRegexpSubstr(str, replace_text, pmatch, src_text);
  		else
! 			appendStringInfoText(str, replace_text);
  
  		search_start = data_pos = pmatch[0].rm_eo;
  
***************
*** 2205,2211 ****
  	{
  		text *right_text = text_substring(PointerGetDatum(src_text),
  								   data_pos + 1, -1, true);
! 		appendStringInfoString(str, PG_TEXT_GET_STR(right_text));
  		pfree(right_text);
  	}
  
--- 2205,2211 ----
  	{
  		text *right_text = text_substring(PointerGetDatum(src_text),
  								   data_pos + 1, -1, true);
! 		appendStringInfoText(str, right_text);
  		pfree(right_text);
  	}
  
