pgsql: Don't use abort(3) in libpq's fe-print.c. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Don't use abort(3) in libpq's fe-print.c.
Date
Msg-id E1lxvpd-000876-91@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Don't use abort(3) in libpq's fe-print.c.

Causing a core dump on out-of-memory seems pretty unfriendly,
and surely is far outside the expected behavior of a general-purpose
library.  Just print an error message (as we did already) and return.
These functions unfortunately don't have an error return convention,
but code using them is probably just looking for a quick-n-dirty
print method and wouldn't bother to check anyway.

Although these functions are semi-deprecated, it still seems
appropriate to back-patch this.  In passing, also back-patch
b90e6cef1, just to reduce cosmetic differences between the
branches.

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/240d56fc4351a6729ec9ddf94a3d338a1e4868ab

Modified Files
--------------
src/interfaces/libpq/fe-print.c | 81 ++++++++++++++++++++++++-----------------
1 file changed, 47 insertions(+), 34 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Add pgindent commit to git-blame-ignore-revs file.
Next
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Add pgindent commit to git-blame-ignore-revs file.