Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMawS-0000Ex-7E for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 16:21:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMawQ-0000sE-Sk for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 16:21:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMawQ-0000s7-KJ for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 16:21:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMawO-0007g6-2J for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 16:21:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x43GLaKw010880; Fri, 3 May 2019 12:21:36 -0400 From: Tom Lane To: Alvaro Herrera cc: Pg Hackers , Tomas Vondra Subject: Re: error messages in extended statistics In-reply-to: <20190503154404.GA7478@alvherre.pgsql> References: <20190503154404.GA7478@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 03 May 2019 11:44:04 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10878.1556900496.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 03 May 2019 12:21:36 -0400 Message-ID: <10879.1556900496@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera 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 (expect= ed 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