}
if (their_version < conn->pversion)
- appendPQExpBuffer(&conn->errorMessage,
- libpq_gettext("protocol version not supported by server: client uses %u.%u, server supports up to %u.%u\n"),
- PG_PROTOCOL_MAJOR(conn->pversion), PG_PROTOCOL_MINOR(conn->pversion),
- PG_PROTOCOL_MAJOR(their_version), PG_PROTOCOL_MINOR(their_version));
+ libpq_append_conn_error(conn, "protocol version not supported by server: client uses %u.%u, server supports up to %u.%u",
+ PG_PROTOCOL_MAJOR(conn->pversion), PG_PROTOCOL_MINOR(conn->pversion),
+ PG_PROTOCOL_MAJOR(their_version), PG_PROTOCOL_MINOR(their_version));
if (num > 0)
+ {
appendPQExpBuffer(&conn->errorMessage,
- libpq_ngettext("protocol extension not supported by server: %s\n",
- "protocol extensions not supported by server: %s\n", num),
+ libpq_ngettext("protocol extension not supported by server: %s",
+ "protocol extensions not supported by server: %s", num),
buf.data);
+ appendPQExpBufferChar(&conn->errorMessage, '\n');
+ }
/* neither -- server shouldn't have sent it */
if (!(their_version < conn->pversion) && !(num > 0))
- appendPQExpBuffer(&conn->errorMessage,
- libpq_gettext("invalid %s message"), "NegotiateProtocolVersion");
+ libpq_append_conn_error(conn, "invalid %s message", "NegotiateProtocolVersion");
termPQExpBuffer(&buf);
return 0;