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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't use abort(3) in libpq's fe-print.c.
Date: 2021-06-28 18:18:05
Message-ID: E1lxvpd-00087C-9t@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/06a2b2fe55807c120b1e27bc6043244518c7de65

Modified Files
--------------
src/interfaces/libpq/fe-print.c | 85 ++++++++++++++++++++++++-----------------
1 file changed, 49 insertions(+), 36 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2021-06-28 19:48:29 Re: pgsql: Add pgindent commit to git-blame-ignore-revs file.
Previous Message Peter Geoghegan 2021-06-28 16:50:35 Re: pgsql: Add pgindent commit to git-blame-ignore-revs file.