Re: [HACKERS] PATCH: multivariate histograms and MCV lists - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Date
Msg-id 20171126033208.5mlutcgtc52y72v6@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] PATCH: multivariate histograms and MCV lists  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
Mark Dilger wrote:


> I understand project policy to allow elog for error conditions that will be reported
> in "can't happen" type situations, similar to how an Assert would be used.  For
> conditions that can happen through (mis)use by the user, ereport is appropriate.
> Not knowing whether you thought these elogs were reporting conditions that a
> user could cause, I did not know if you should change them to ereports, or if you
> should just add a brief comment along the lines of /* should not be possible */.

Two things dictate that policy:

1. messages are translated by default for ereport but not for elog.
Both things can be overridden, but we tend not to do it unless there's
no choice.

2. you can assign SQLSTATE only with ereport.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Next
From: Hadi Moshayedi
Date:
Subject: [PATCH] Fix crash in int8_avg_combine().