pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Clear conn->errorMessage at successful completion of PQconnectdb
2+ messages / 1 participants
[nested] [flat]

* pgsql: Clear conn->errorMessage at successful completion of PQconnectdb
@ 2021-09-13 20:53 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-09-13 20:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/138531f1bbc333745bd8422371c07e7e108d5528

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Clear conn->errorMessage at successful completion of PQconnectdb
@ 2021-09-13 20:53 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-09-13 20:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-09-13 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 20:53 pgsql: Clear conn->errorMessage at successful completion of PQconnectdb Tom Lane <tgl@sss.pgh.pa.us>
2021-09-13 20:53 pgsql: Clear conn->errorMessage at successful completion of PQconnectdb Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox