Re: [PATCH] Fix trigger argument propagation to child partitions

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Patrick McHardy <kaber(at)trash(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Fix trigger argument propagation to child partitions
Date: 2019-07-09 20:51:46
Message-ID: 20190709205146.GA1044@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Jul-09, Tomas Vondra wrote:

> On Tue, Jul 09, 2019 at 03:00:27PM +0200, Patrick McHardy wrote:
> > The following patch fixes propagation of arguments to the trigger
> > function to child partitions both when initially creating the trigger
> > and when adding new partitions to a partitioned table.
>
> Thanks for the report and bugfix. It seeem the parameters in row triggers
> on partitioned tables never worked :-( For a moment I was wondering why it
> shows on 11 and not 10 (based on the assumption you'd send a patch against
> 10 if it was affected), but 10 actually did not support row triggers on
> partitioned tables.

Right ...

> The fix seems OK to me, although I see we're parsing tgargs in ruleutils.c
> and that version (around line ~1050) uses fastgetattr instead of
> heap_getattr, and checks the isnull parameter after the call. I guess we
> should do the same thing here.

Yeah, absolutely. The attached v2 is basically Patrick's patch with
very minor style changes. I'll get this pushed as soon as the tests
finish running.

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

Attachment Content-Type Size
v2-0001-first.patch text/x-diff 5.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2019-07-09 20:59:11 Re: [HACKERS] Cached plans and statement generalization
Previous Message Tom Lane 2019-07-09 20:39:02 Re: Broken defenses against dropping a partitioning column