From: "Amit Kapila" <>
Is there a need to free memory context in PG_CATCH()?
In error path the memory due to this temporary context will get
freed as it will delete the transaction context and this
temporary context will definitely be in the hierarchy of it, so
it should also get deleted.  I think such handling can be
useful incase we use PG_CATCH() to suppress the error.

I thought the same, but I also felt that I should make an effort to release resources as soon as possible, considering the memory context auto deletion as a last resort. However, looking at other places where PG_CATCH() is used, memory context is not deleted. So, I removed the modification from PG_CATCH() block. Thanks.


Attachment: dblink_memleak_v2.patch
Description: Binary data

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to