From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Subject: Re: error messages in extended statistics
Date: Fri, 03 May 2019 12:21:36 -0400
Message-ID: <10879.1556900496@sss.pgh.pa.us> (raw)
In-Reply-To: <20190503154404.GA7478@alvherre.pgsql>
References: <20190503154404.GA7478@alvherre.pgsql>
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.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, tomas.vondra@2ndquadrant.com
Subject: Re: error messages in extended statistics
In-Reply-To: <10879.1556900496@sss.pgh.pa.us>
References: <20190503154404.GA7478@alvherre.pgsql> <10879.1556900496@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