Re: [bug fix] Memory leak in dblink

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Joe Conway" <mail(at)joeconway(dot)com>, "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Memory leak in dblink
Date: 2014-06-19 14:55:04
Message-ID: FC0B2DE4D8E147018FEC13A9371B98A6@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Joe Conway" <mail(at)joeconway(dot)com>
> I think the context deletion was missed in the first place because
> storeRow() is the wrong place to create the context. Rather than
> creating the context in storeRow() and deleting it two levels up in
> materializeQueryResult(), I think it should be created and deleted in
> the interim layer, storeQueryResult(). Patch along those lines attached.
>
> Any objections to me back-patching it this way?

I thought the same at first before creating the patch, but I reconsidered.
If the query executed by dblink() doesn't return any row, the context
creation and deletion is a waste of processing. I think the original author
wanted to eliminate this waste by creating the context when dblink() should
return a row. I'd like to respect his thought.

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-06-19 15:00:51 Re: Atomics hardware support table & supported architectures
Previous Message Merlin Moncure 2014-06-19 14:43:12 Re: Atomics hardware support table & supported architectures