@@ -446,13 +446,13 @@ repack_one_table(const repack_table *table, const char *orderby)
446
446
command (sql .data , 0 , NULL );
447
447
command ("COMMIT" , 0 , NULL );
448
448
449
- PQclear ( PQexec ( conn2 , "BEGIN ISOLATION LEVEL READ COMMITTED" ) );
449
+ pgut_command ( conn2 , "BEGIN ISOLATION LEVEL READ COMMITTED" , 0 , NULL );
450
450
elog (DEBUG2 , "Obtaining ACCESS SHARE lock for %s" , table -> target_name );
451
451
452
452
/* XXX: table name escaping? */
453
453
printfStringInfo (& sql , "LOCK TABLE %s IN ACCESS SHARE MODE" ,
454
454
table -> target_name );
455
- res = PQexec (conn2 , sql .data );
455
+ res = pgut_execute (conn2 , sql .data , 0 , NULL );
456
456
if (PQresultStatus (res ) != PGRES_COMMAND_OK )
457
457
{
458
458
printf ("%s" , PQerrorMessage (conn2 ));
@@ -466,7 +466,7 @@ repack_one_table(const repack_table *table, const char *orderby)
466
466
/* store the backend PID of our connection keeping an ACCESS SHARE
467
467
lock on the target table.
468
468
*/
469
- res = PQexec (conn2 , "SELECT pg_backend_pid()" );
469
+ res = pgut_execute (conn2 , "SELECT pg_backend_pid()" , 0 , NULL );
470
470
if (PQresultStatus (res ) != PGRES_TUPLES_OK )
471
471
{
472
472
printf ("%s" , PQerrorMessage (conn2 ));
@@ -688,7 +688,7 @@ lock_exclusive(const char *relid, const char *lock_query, bool release_conn2)
688
688
* lock.
689
689
*/
690
690
if (release_conn2 )
691
- PQclear ( PQexec ( conn2 , "COMMIT" ) );
691
+ pgut_command ( conn2 , "COMMIT" , 0 , NULL );
692
692
693
693
/* wait for a while to lock the table. */
694
694
wait_msec = Min (1000 , i * 100 );
@@ -740,7 +740,7 @@ repack_cleanup(bool fatal, void *userdata)
740
740
741
741
/* Rollback current transaction */
742
742
if (conn2 )
743
- PQclear ( PQexec ( conn2 , "ROLLBACK" ) );
743
+ pgut_command ( conn2 , "ROLLBACK" , 0 , NULL );
744
744
745
745
if (connection )
746
746
command ("ROLLBACK" , 0 , NULL );
0 commit comments