On 31/12/2018 16:55, Andres Freund wrote:
> I think we should aim to unify the use (in contrast to the
> implementation) of logging as much as possible, rather than having a
> separate API for it for client programs.

I opted against doing that, for mainly two reasons: One, I think the
ereport() API is too verbose for this purpose, an invocation is usually
two to three lines.  My goal was to make logging smaller and more
compact.  Two, I think tying error reporting to flow control does not
always work well and leads to bad code and a bad user experience.
Relatedly, rewriting all the frontend programs to exception style would
end up being a 10x project to rewrite everything for no particular
benefit.  Going from 8 or so APIs to 2 is already an improvement, I
think.  If someone wants to try going further, it can be considered, but
it would be an entirely different project.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Reply via email to