> All local memory is safe to handle that way. In my case I am reallocating memory for a global variable between transactions. I wanted to make sure I don't leave allocated memory behind.
> The problem only arises when you have memory to release _earlier_ than that. First I was looking for a way to free my allocated memory before exit. I found the proc_exit hook mechanism but I am not sure where to setup this hook. Given allocating memory in TopMemoryContext is the same as malloc, then I'll just leave my allocated memory to be freed automatically when exit. Thank you :) Regards, Gevik ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster