Skip to content

Commit

Permalink
Merge pull request #375 from Melkij/bug_oid_should_be_unsigned
Browse files Browse the repository at this point in the history
Fix wrong OID format type in repack_trigger
  • Loading branch information
Melkij authored Dec 15, 2023
2 parents 624745b + ca7a175 commit 3ecda64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ecda64

Please sign in to comment.