Re: [HACKERS] Getting rid of "unknown error" in dblink and postgres_fdw - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Getting rid of "unknown error" in dblink and postgres_fdw
Date
Msg-id 20648.1482339934@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Getting rid of "unknown error" in dblink and postgres_fdw  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Dec 21, 2016 at 9:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> A possible objection is that if we really are on the hairy edge of OOM,
>> trying to construct such error strings might push us over the edge

> What am I missing here?  Constructing said string occurs on the local end
> of the connection but the memory problem exists on the remote end.

Um, that's not clear, in fact it's not likely.  The backend usually
manages to tell you so if it's out of memory --- or, worst case, it
crashes trying, in which case the local libpq ought to gin up a report
about loss of connection.  So the root cause I'm suspecting is that
the local libpq was unable to obtain memory for a PGresult or something
like that.  That theory has some holes of its own, because libpq also
keeps some cards up its sleeve that usually let it report out-of-memory
successfully, but it's the best I can do with the info at hand.

In any case, the point of the error style guidelines is that it's *always*
possible to do better than "unknown error"; now that it's been proven
that this case is reachable in the field, we should try harder.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Getting rid of "unknown error" in dblink and postgres_fdw
Next
From: Joe Conway
Date:
Subject: Re: [HACKERS] Getting rid of "unknown error" in dblink andpostgres_fdw