Re: [GENERAL] Can SET_VARSIZE cause a memory leak?

2016-06-08 Thread Michael Paquier
On Wed, Jun 8, 2016 at 9:55 PM, Albe Laurenz wrote: > This is safe, and the memory will be freed at the end of the transaction. Yes, palloc takes memory from the current memory context. The case where you would need to use pfree is if there is an allocation continuously

Re: [GENERAL] Can SET_VARSIZE cause a memory leak?

2016-06-08 Thread Albe Laurenz
Николай Бабаджанян wrote: > I didn't find an easy way to convert ucs-2 bytea to utf-8, so I decided to > write a C-function. Since > ucs-2 is has fixed symbol size of 2 bytes the output bytea size may differ. > > I do the following: > > bytea *result= (bytea *)