Re: Index created in BEFORE trigger not updated during INSERT

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index created in BEFORE trigger not updated during INSERT
Date: 2017-06-03 22:44:54
Message-ID: CAB7nPqS2gYpxS2yjOgaq58YA+GG-je6mi8LBhdOvWyCV64_ovw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 4, 2017 at 7:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I'm unsure whether to back-patch or not; the main argument for not doing
> so is that if any extensions are calling DefineIndex() directly, this
> would be an API break for them. Given what a weird case this is, I'm not
> sure it's worth that.

Knowing that it has taken 20 years to get a report for this problem,
It seems to me that one report does not win against the risk of
destabilizing extensions that would surprisingly break after a minor
update.

> A possible end-run around the API objection would be to not add an extra
> argument to DefineIndex() in the back branches, but to use !is_alter_table
> as the control condition. That would work for the core callers, although
> we might need a special case for bootstrap mode. On the other hand,
> thinking again about hypothetical third-party callers, it's possible that
> that's not the right answer for them, in which case they'd be really in
> trouble. So I'm not that much in love with that answer.

Yes, that's not worth the trouble I think for back-branches.

The patch looks good to me, could you add a regression test? This
could be used later on as a basis for other DDL commands if somebody
looks at this problem for the other ones.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-06-03 22:47:15 Re: Index created in BEFORE trigger not updated during INSERT
Previous Message Kevin Grittner 2017-06-03 22:41:33 Re: PG10 transition tables, wCTEs and multiple operations on the same table