Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hl6bp-0005XU-6w for pgsql-committers@arkaria.postgresql.org; Wed, 10 Jul 2019 07:01:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hl6bo-0005J6-3l for pgsql-committers@arkaria.postgresql.org; Wed, 10 Jul 2019 07:01:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hl6bm-0005A1-O0 for pgsql-committers@lists.postgresql.org; Wed, 10 Jul 2019 07:01:43 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hl6bi-0000Q9-Em for pgsql-committers@lists.postgresql.org; Wed, 10 Jul 2019 07:01:42 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0292C220E7; Wed, 10 Jul 2019 03:01:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 10 Jul 2019 03:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Y8j6l81XvJpWs1d7psYoPLNNimK iFjrPIcdti3irsyU=; b=Fp/uo0lDn6LN1nwbspLpL+JU8hHtCjXLoGAKzNqE/XC FSYI6ch8+E+72C/ZVOcKNGtwITjKrfk/1HJwGSYp16MdchDJLkW6TSip5cAnbgqu yEuNfOuPzdow8v9er9tft30vyPh0WSUT474XJfAShcHf0G3Ziwck/j58PWCG8O5f E25qA8wZsmKK0NxCFem52twzCWyhSxzyVC9SLMTRtksYgHNX8LjSI6vT3SpUGS7u 5TbqaNpCL9wQH4h9XCd+DqZD1l64gUkvYp0XT38R80BLib7vp19TMsP1fCifl4Dh 9x4QpqHuLgnLIkEGrLJhtlGjMRoulEJrh36B4U5uw9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Y8j6l8 1XvJpWs1d7psYoPLNNimKiFjrPIcdti3irsyU=; b=NHcf7gvyIRvsyUvMCvKFLy ofz8dXsiCZKPuF0OCE7iSYfaUAOH+EyhV10hpOwQAQ0Wy+qFFLVvxAfMeo+jWXUo foxTCcv0ip2/hpEGnl2KuUOPv1srxPxjfESezzLLU0fZ7r5cbM8aXqT8gUJagNFF OMyBcot1VUI4iDMozCZLVqnW9jkaMvyDq6oBM2nPlTlGDoftiCxCit6vvLZIEEuY josaITu8vcZ8API5gCAQbhZPcgegQ9Iwpq4mZPkOfq5Je+3L4GWlR6fa2E5kSGdJ Tl/HmQ19vABQVizpEJtjGlpQNijgw1q7tDG35g+kwG3bAwWJQ1d4C9/hFtPQlPuw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeehgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttdej necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuffhomhgrihhnpehpghhsqhhlrdgsuhhilhgupdhpohhsthhg rhgvshhqlhdrohhrghenucfkphepudduuddruddtvddrudektddrudekheenucfrrghrrg hmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhu shhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 9CB638005C; Wed, 10 Jul 2019 03:01:30 -0400 (EDT) Date: Wed, 10 Jul 2019 16:01:22 +0900 From: Michael Paquier To: Alvaro Herrera Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Propagate trigger arguments to partitions Message-ID: <20190710070122.GE1031@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Zs/RYxT/hKAHzkfQ Content-Type: multipart/mixed; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alvaro, On Tue, Jul 09, 2019 at 09:23:45PM +0000, Alvaro Herrera wrote: > Propagate trigger arguments to partitions >=20 > 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. >=20 > 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=3Dprion&dt=3D2019-0= 7-10%2006%3A27%3A02 /home/ec2-user/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/comma= nds/tablecmds.c: In function =E2=80=98CloneRowTriggersToPartition=E2=80=99: /home/ec2-user/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/comma= nds/tablecmds.c:15283:4: error: =E2=80=98for=E2=80=99 loop initial declarations are only allowed in = C99 mode for (int i =3D 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 --10jrOL3x2xqLmOsH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="buildfarm-fix-11.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablec= mds.c index 5fbe7242c4..70bbe052e1 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -15271,6 +15271,7 @@ CloneRowTriggersToPartition(Relation parent, Relati= on partition) if (trigForm->tgnargs > 0) { char *p; + int i; =20 value =3D heap_getattr(tuple, Anum_pg_trigger_tgargs, RelationGetDescr(pg_trigger), &isnull); @@ -15280,7 +15281,7 @@ CloneRowTriggersToPartition(Relation parent, Relati= on partition) =20 p =3D (char *) VARDATA_ANY(DatumGetByteaPP(value)); =20 - for (int i =3D 0; i < trigForm->tgnargs; i++) + for (i =3D 0; i < trigForm->tgnargs; i++) { trigargs =3D lappend(trigargs, makeString(pstrdup(p))); p +=3D strlen(p) + 1; --10jrOL3x2xqLmOsH-- --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl0ljUIACgkQnvQgOdby QH2MIhAAkT4whIIJ98wnuPskpfZsJb9Ppv7K0juDzmrkVuupgiqae63kLCPO+awc dFiG2DtNvwrABKO4zS9g6DylI4Z8Yg8C43+XdqUi8h5DyyFG8Gp+CZS0a5UCfHsg BlSc8D76DYfitrsB2JbH0k+np4OaUEpd4+zNapDVTH1eNsxUd9cQsRLyBlcLPU5z CCezXZrl0chEKqGuGLpnnY/qasU2vycpp03T53j81Dr7ka4XZH8vDlikiwsDTUCp x+AnZ3KdG5OwE6wB1srD6wgvj1oBf7wiuAMNSjdWF2fhGP2n9fAEenh3vrXNWm0+ xFnY939tAV+JNnSTuRIQ/qgGkknv6P2aA3eio9UdynVDO1OyQUlMbL+wquF4GWMU g9C/25068HdnNvVKzyVHOrlbh3Sy6NNyILkLJ/hdeBiQlpor3sCUSnUoe4m80kuy jxnZkY6ThQ9/AEbcdYE6hV0Slj5GIVmnT34xbTpd91yML/wssVvr7ayRQ7qKe03i Yt9CPzqN6wZaV1hZeyV1U5korq7L3yZiPFDcw7MXvzsnEGjh0lxV6RMk66EfeiZF po2jTV9XyNq9Jit+gcpoFPcqeSoX+wBoblYy7kq34UMYbRZ4y+D2T6/BmIkCXg0B 8RPv+7OoKaojnJ6K5zuOBkGahbBhOQS7hnMByArXiYoW0NzEfJQ= =TmiI -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ--