pgsql: Clear conn->errorMessage at successful completion of PQconnectdb

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Clear conn->errorMessage at successful completion of PQconnectdb
Дата
Msg-id E1mPsx7-00067E-Hw@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Clear conn->errorMessage at successful completion of PQconnectdb().

Commits ffa2e4670 and 52a10224e caused libpq's connection-establishment
functions to usually leave a nonempty string in the connection's
errorMessage buffer, even after a successful connection.  While that
was intentional on my part, more sober reflection says that it wasn't
a great idea: the string would be a bit confusing.  Also this broke at
least one application that checked for connection success by examining
the errorMessage, instead of using PQstatus() as documented.  Let's
clear the buffer at success exit, restoring the pre-v14 behavior.

Discussion: https://postgr.es/m/4170264.1620321747@sss.pgh.pa.us

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/896a0c44f93b0b449fdf7e6c3973deab5fdfed4f

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 7 +++++++
1 file changed, 7 insertions(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Doc: improve documentation of CREATE/ALTER SUBSCRIPTION.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix potential for compiler warning in GlobalVisTestFor().