Am 04.03.18 20:52 schrieb(en) Tom Lane:
> From the docs, for me it is not clear whether the value assigned using
SET_VARSIZE() must be the *exact* size of the newly allocated return value, or just
the length of the text plus the header size. IOW would the code above create a
memory leak if o
Albrecht =?iso-8859-1?b?RHJl3w==?= writes:
> text *t = PG_GETARG_TEXT_PP(0);
> size_tout_len = 0U;
> // allocate to the max. possible output size
> text *new_t = (text *) palloc(VARSIZE_ANY_EXHDR(t) + VARHDRSZ);
> // copy data to VARDATA(new_t), and count byt