diff --git a/lib/repack.c b/lib/repack.c index 66e6d66..ff60df8 100644 --- a/lib/repack.c +++ b/lib/repack.c @@ -206,12 +206,12 @@ repack_trigger(PG_FUNCTION_ARGS) /* prepare INSERT query */ sql = makeStringInfo(); - appendStringInfo(sql, "INSERT INTO repack.log_%d(pk, row) " + appendStringInfo(sql, "INSERT INTO repack.log_%u(pk, row) " "VALUES(CASE WHEN $1 IS NULL THEN NULL ELSE (ROW(", relid); appendStringInfo(sql, "$1.%s", quote_identifier(trigdata->tg_trigger->tgargs[0])); for (int i = 1; i < trigdata->tg_trigger->tgnargs; ++i) appendStringInfo(sql, ", $1.%s", quote_identifier(trigdata->tg_trigger->tgargs[i])); - appendStringInfo(sql, ")::repack.pk_%d) END, $2)", relid); + appendStringInfo(sql, ")::repack.pk_%u) END, $2)", relid); /* execute the INSERT query */ execute_with_args(SPI_OK_INSERT, sql->data, 2, argtypes, values, nulls);