Re: setting estate in ExecInitNode() itself

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

Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> writes:
> Looking at ExecInitXYZ() functions, we can observe that every such
> function has a statement like
> XYZstate->ps.state = estate;
> where it saves estate in the PlanState.

Yeah ...

> 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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Nenciarini 2018-01-05 15:46:09 Re: [PATCH] Logical decoding of TRUNCATE
Previous Message Alvaro Herrera 2018-01-05 15:30:23 Re: Failed to delete old ReorderBuffer spilled files