Re: Unused member root in foreign_glob_cxt

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: Unused member root in foreign_glob_cxt
Date: 2017-01-13 13:16:21
Message-ID: 30413.1484313381@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:
> On Thu, Jan 12, 2017 at 6:39 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think you'd just end up putting it back at some point. It's the only
>> means that foreign_expr_walker() has for getting at the root pointer,
>> and nearly all planner code needs that. Seems to me it's just chance
>> that foreign_expr_walker() doesn't need it right now.

> I agree with you that most of the planner code needs that but not
> every planner function accepts root as an argument.

[ shrug... ] The general trend in the planner is that things get more
complicated because we start accounting for new effects. I don't have
any faith in the claim that because is_foreign_expr hasn't needed
PlannerInfo yet, it never will, because what it's required to do is
inherently spongy and complicated. It wouldn't particularly surprise
me if someone wanted to start putting cost considerations in there,
for example.

In short, I think that removing this argument is just make-work that
we're very likely to have to undo at some point; and the further you
extend the changes, the larger a hazard for back-patching it will be.

If you can convince some other committer that this is a good idea, fine,
but I won't commit it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-01-13 13:21:02 how to correctly invalidate a constraint?
Previous Message Michael Paquier 2017-01-13 13:09:32 Re: Patch to implement pg_current_logfile() function