From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Jacob Champion <pchampion@vmware.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Subject: Re: [PATCH] Make jsonapi usable from libpq
Date: Wed, 30 Jun 2021 16:13:56 -0400
Message-ID: <622803.1625084036@sss.pgh.pa.us> (raw)
In-Reply-To: <bf828721-ef3e-2a8a-feeb-ade81a4b8f91@enterprisedb.com>
References: <a250d475ba1c0cc0efb7dfec8e538fcc77cdcb8e.camel@vmware.com>
<YNQedHwheUaTnnGt@paquier.xyz>
<daeb22ec6ca8ef61e94d766a9b35fb03cabed38e.camel@vmware.com>
<YNZ2mnsbDVJQrA/a@paquier.xyz>
<3045186.1624729430@sss.pgh.pa.us>
<bf828721-ef3e-2a8a-feeb-ade81a4b8f91@enterprisedb.com>
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> On 26.06.21 19:43, Tom Lane wrote:
>> fe-print.c's handling of OOM isn't nice at all:
>> fprintf(stderr, libpq_gettext("out of memory\n"));
>> abort();
>> Although fe-print.c is semi-deprecated, it still seems like it'd
>> be a good idea to clean that up.
> These abort() calls were put there on purpose by:
> commit c6ea8ccea6bf23501962ddc7ac9ffdb99c8643e1
> Use abort() instead of exit() to abort library functions
Well, the exit() calls that that replaced were quite inappropriate
too IMO. I don't think it boots much to argue about which way was
less bad; libpq has no business doing either thing.
What might be more useful is to consider whether there's a way
to retrofit an error-reporting convention onto these functions.
I thought about that for a bit, but concluded that the possible
interactions with stdio's error handling made that fairly tricky,
and it didn't seem worth messing with for such backwater code.
(Too bad POSIX didn't see fit to provide seterr(FILE*), or maybe
we could have reported OOM in fe-print that way.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, michael@paquier.xyz, pchampion@vmware.com, daniel@yesql.se
Subject: Re: [PATCH] Make jsonapi usable from libpq
In-Reply-To: <622803.1625084036@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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