pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Propagate trigger arguments to partitions
Date: Wed, 10 Jul 2019 16:01:22 +0900
Message-ID: <20190710070122.GE1031@paquier.xyz> (raw)
In-Reply-To: <E1hkxaT-0000oz-0J@gemulon.postgresql.org>
References: <E1hkxaT-0000oz-0J@gemulon.postgresql.org>

Hi Alvaro,

On Tue, Jul 09, 2019 at 09:23:45PM +0000, Alvaro Herrera wrote:
> Propagate trigger arguments to partitions
> 
> We were creating the cloned triggers with an empty list of arguments,
> losing the ones that had been specified by the user when creating the
> trigger in the partitioned table.  Repair.
> 
> This was forgotten in commit 86f575948c77.

This commit has broken the buildfarm on REL_11_STABLE for a couple of
animals:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2019-07-10%2006%3A27%3A02

/home/ec2-user/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/commands/tablecmds.c:
In function ‘CloneRowTriggersToPartition’:
/home/ec2-user/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/commands/tablecmds.c:15283:4:
error: ‘for’ loop initial declarations are only allowed in C99 mode
    for (int i = 0; i < trigForm->tgnargs; i++)

This gets fixed with the attached.  I would personally keep the code
consistent for v12 and HEAD for this code path, but I am fine to let
you decide the way you prefer.
--
Michael

Attachments:

buildfarm-fix-11.patch (text/x-diff, 784B) download diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 5fbe7242c4..70bbe052e1 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -15271,6 +15271,7 @@ CloneRowTriggersToPartition(Relation parent, Relation partition) if (trigForm->tgnargs > 0) { char *p; + int i; value = heap_getattr(tuple, Anum_pg_trigger_tgargs, RelationGetDescr(pg_trigger), &isnull); @@ -15280,7 +15281,7 @@ CloneRowTriggersToPartition(Relation parent, Relation partition) p = (char *) VARDATA_ANY(DatumGetByteaPP(value)); - for (int i = 0; i < trigForm->tgnargs; i++) + for (i = 0; i < trigForm->tgnargs; i++) { trigargs = lappend(trigargs, makeString(pstrdup(p))); p += strlen(p) + 1;
signature.asc (application/pgp-signature, 832B) download

view thread (6+ messages)  latest in thread

Message-ID: <20190710070122.GE1031@paquier.xyz>
Permalink:  ../20190710070122.GE1031@paquier.xyz/
Also on:    postgresql.org/message-id/20190710070122.GE1031@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Propagate trigger arguments to partitions
  In-Reply-To: <20190710070122.GE1031@paquier.xyz>
  References: <E1hkxaT-0000oz-0J@gemulon.postgresql.org> <20190710070122.GE1031@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox