Re: [bug fix] Memory leak in dblink - Mailing list pgsql-hackers

From MauMau
Subject Re: [bug fix] Memory leak in dblink
Date
Msg-id FC0B2DE4D8E147018FEC13A9371B98A6@maumau
Whole thread Raw
In response to Re: [bug fix] Memory leak in dblink  (Joe Conway <mail@joeconway.com>)
Responses Re: [bug fix] Memory leak in dblink
List pgsql-hackers
From: "Joe Conway" <mail@joeconway.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




pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Atomics hardware support table & supported architectures
Next
From: Alvaro Herrera
Date:
Subject: Re: Atomics hardware support table & supported architectures