Skip to content

Commit 2926529

Browse files
committed
mv
1 parent b8156fa commit 2926529

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

work.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ static void work_connect(Task *t) {
441441
if (connected) {
442442
if (!(t->pid = PQbackendPID(t->conn))) { work_error((errcode(ERRCODE_CONNECTION_EXCEPTION), errmsg("PQbackendPID failed"), work_errdetail(PQerrorMessage(t->conn)))); return; }
443443
if (!lock_table_pid_hash(t->shared->oid, t->pid, t->shared->hash)) { work_error((errcode(ERRCODE_LOCK_NOT_AVAILABLE), errmsg("!lock_table_pid_hash(%i, %i, %i)", t->shared->oid, t->pid, t->shared->hash))); return; }
444+
if (PQclientEncoding(t->conn) != GetDatabaseEncoding() && PQsetClientEncoding(t->conn, GetDatabaseEncodingName()) == -1) { work_error((errcode(ERRCODE_CONNECTION_EXCEPTION), errmsg("PQsetClientEncoding failed"), work_errdetail(PQerrorMessage(t->conn)))); return; }
444445
work_query(t);
445446
}
446447
}
@@ -534,7 +535,6 @@ static void work_remote(Task *t) {
534535
else if (PQstatus(t->conn) == CONNECTION_BAD) work_error((errcode(ERRCODE_CONNECTION_FAILURE), errmsg("PQstatus == CONNECTION_BAD"), work_errdetail(PQerrorMessage(t->conn))));
535536
else if (!PQisnonblocking(t->conn) && PQsetnonblocking(t->conn, true) == -1) work_error((errcode(ERRCODE_CONNECTION_EXCEPTION), errmsg("PQsetnonblocking failed"), work_errdetail(PQerrorMessage(t->conn))));
536537
else if (!superuser() && !PQconnectionUsedPassword(t->conn)) work_error((errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), errmsg("password is required"), errdetail("Non-superuser cannot connect if the server does not request a password."), errhint("Target server's authentication method must be changed.")));
537-
else if (PQclientEncoding(t->conn) != GetDatabaseEncoding() && PQsetClientEncoding(t->conn, GetDatabaseEncodingName()) == -1) work_error((errcode(ERRCODE_CONNECTION_EXCEPTION), errmsg("PQsetClientEncoding failed"), work_errdetail(PQerrorMessage(t->conn))));
538538
pfree(name.data);
539539
pfree(value.data);
540540
pfree(keywords);

0 commit comments

Comments
 (0)