Re: error messages in extended statistics
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-05-03T19:42:17Z
Lists: pgsql-hackers
On Fri, May 03, 2019 at 12:21:36PM -0400, Tom Lane wrote: >Alvaro Herrera <alvherre@2ndquadrant.com> writes: >> Error reporting in extended statistics is inconsistent -- many messages >> that are ereport() in mvdistinct.c are elog() in the other modules. >> ... >> I think this should be cleaned up, while at the same time not giving too >> much hassle for translators; for example, this message >> dependencies.c: elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)", >> should not only be turned into an ereport(), but also the MVDependencies >> part turned into a %s. (Alternatively, we could decide I was wrong and >> turn them all back into elogs, but I obviously vote against that.) > >FWIW, I'd vote the other way: that seems like a clear "internal error", >so making translators deal with it is just make-work. It should be an >elog. If there's a reasonably plausible way for a user to trigger an >error condition, then yes ereport, but if we're reporting situations >that couldn't happen without a server bug then elog seems fine. > Yeah, I agree. Most of (peshaps all) those errors are internal errors, and thus should be elog. I'll take care of clening this up a bit. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Make error logging in extended statistics more consistent
- 39c9efc15646 10.9 landed
- 9c9a74cd3257 11.4 landed
- fe415ff10408 12.0 landed