From: Alvaro Herrera Date: Wed, 10 Jul 2019 13:01:28 +0000 (-0400) Subject: Fix compile failure X-Git-Tag: REL_11_5~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ede93de9e80f0f39276c0afabf1621d21180370;p=postgresql Fix compile failure REL_11_STABLE's configure does not select C99 mode by default, so using C99 block initializer broke the build for some compilers. Revert to C89 in that branch. Author: Michaƫl Paquier Discussion: https://postgr.es/m/20190710070122.GE1031@paquier.xyz --- 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;