string_agg_optim.diff

text/x-patch

Filename: string_agg_optim.diff
Type: text/x-patch
Part: 0
Message: patch: very simply optimalization of string_agg

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/backend/utils/adt/varlena.c 1 1
*** ./src/backend/utils/adt/varlena.c.orig	2011-12-21 10:46:33.000000000 +0100
--- ./src/backend/utils/adt/varlena.c	2011-12-21 11:08:42.583720151 +0100
***************
*** 3668,3674 ****
  	state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0);
  
  	if (state != NULL)
! 		PG_RETURN_TEXT_P(cstring_to_text(state->data));
  	else
  		PG_RETURN_NULL();
  }
--- 3668,3674 ----
  	state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0);
  
  	if (state != NULL)
! 		PG_RETURN_TEXT_P(cstring_to_text_with_len(state->data, state->len));
  	else
  		PG_RETURN_NULL();
  }