Re: pgsql: Fix event triggers for partitioned tables

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix event triggers for partitioned tables
Date: 2018-10-08 12:54:25
Message-ID: 20181008125425.ims7ibk4pefwmg7q@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2018-Oct-08, Michael Paquier wrote:

> Hi Alvaro,
>
> On Sat, Oct 06, 2018 at 10:18:46PM +0000, Alvaro Herrera wrote:
> > Fix event triggers for partitioned tables
> >
> > Index DDL cascading on partitioned tables introduced a way for ALTER
> > TABLE to be called reentrantly. This caused an an important deficiency
> > in event trigger support to be exposed: on exiting the reentrant call,
> > the alter table state object was clobbered, causing a crash when the
> > outer alter table tries to finalize its processing. Fix the crash by
> > creating a stack of event trigger state objects. There are still ways
> > to cause things to misbehave (and probably other crashers) with more
> > elaborate tricks, but at least it now doesn't crash in the obvious
> > scenario.
>
> This commit is producing a warning with my compiler:
> event_trigger.c:1764:9: note: in expansion of macro ‘OidIsValid’
> Assert(OidIsValid(currentEventTriggerState->currentCommand));
>
> The fix is obvious because currentCommand is a pointer and not an Oid.
> Please see attached. Should I fix it myself?

If you have a commit ready, please do, thanks.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-10-08 13:38:57 pgsql: Silence compiler warning in Assert()
Previous Message Peter Eisentraut 2018-10-08 10:04:41 pgsql: Translation updates

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-10-08 13:13:33 Re: exclude tmp_check and tmp_install from pgindent
Previous Message Andrew Dunstan 2018-10-08 12:33:38 Re: exclude tmp_check and tmp_install from pgindent