Skip to content

Commit 4062676

Browse files
schmiddydvarrazzo
authored andcommitted
Since commit 742380f0429b6 included some of the same changes
already in 6a0af679e14d1d, go ahead and include a few more of the error cleanup from 6a0af679e14d1d.
1 parent 34605ae commit 4062676

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

bin/pg_repack.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ repack_one_database(const char *orderby)
331331
else
332332
{
333333
/* exit otherwise */
334-
printf("%s", PQerrorMessage(connection));
334+
elog(ERROR, "%s", PQerrorMessage(connection));
335335
PQclear(res);
336336
exit(1);
337337
}
@@ -892,12 +892,9 @@ lock_access_share(PGconn *conn, Oid relid, const char *target_name)
892892
}
893893
else if (sqlstate_equals(res, SQLSTATE_QUERY_CANCELED))
894894
{
895-
/* XXX: does this ROLLBACK need any rethinking wrt. two connections
896-
* now?
897-
*/
898895
/* retry if lock conflicted */
899896
PQclear(res);
900-
pgut_command(conn, "ROLLBACK", 0, NULL);
897+
pgut_rollback(conn);
901898
continue;
902899
}
903900
else
@@ -981,12 +978,9 @@ lock_exclusive(PGconn *conn, const char *relid, const char *lock_query, bool sta
981978
}
982979
else if (sqlstate_equals(res, SQLSTATE_QUERY_CANCELED))
983980
{
984-
/* XXX: does this ROLLBACK need any rethinking wrt. two connections
985-
* now?
986-
*/
987981
/* retry if lock conflicted */
988982
PQclear(res);
989-
pgut_command(conn, "ROLLBACK", 0, NULL);
983+
pgut_rollback(conn);
990984
continue;
991985
}
992986
else

0 commit comments

Comments
 (0)