Re: setting estate in ExecInitNode() itself

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: setting estate in ExecInitNode() itself
Date: 2018-01-05 19:55:50
Message-ID: 10269.1515182150@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2018-01-05 10:36:19 -0500, Tom Lane wrote:
>> Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> writes:
>>> I am wondering why don't we instead save estate in ExecInitNode() itself like
>>> result->estate = estate;

>> That would only work if there were no situation where the field needed to
>> be already valid during the node init function. I think that's probably
>> wrong already (check ExecInitExpr for instance) and it certainly might
>> be wrong in future.

> Agreed on that. But I also think there's quite some room for
> centralizing some of the work done in the init routines. Not quite sure
> how, but I do dislike the amount of repetition both in code and
> comments.

Yeah, there might be room for putting more of the common node init work
into standard macros or some such. Need to think bigger than just this
one point though, or it won't be worth it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-01-05 20:01:37 Re: setting estate in ExecInitNode() itself
Previous Message Robert Haas 2018-01-05 19:52:38 Re: Condition variable live lock