Re: Frontend error logging style

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Frontend error logging style
Date: 2021-11-19 10:17:50
Message-ID: a06f311b-18cd-ee56-ad4c-03ed0f93713f@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16.11.21 16:18, Robert Haas wrote:
> I think we need frontend facilities that look like the backend
> facilities, so try/catch blocks, on-exit callbacks, and whatever else
> there is. Otherwise code reuse is going to continue to be annoying.

If people want to do that kind of thing (I'm undecided whether the
complexity is worth it), then make it a different API. The pg_log_*
calls are for writing formatted output. They normalized existing
hand-coded patterns at the time. We can wrap another API on top of them
that does flow control and output. The pg_log_* stuff is more on the
level of syslog(), which also just outputs stuff. Nobody is suggesting
that syslog(LOG_EMERG) should exit the program automatically. But you
can wrap higher-level APIs such as ereport() on top of that that might
do that.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-11-19 10:23:08 Re: Non-superuser subscription owners
Previous Message Peter Eisentraut 2021-11-19 10:10:46 Re: Deficient error handling in pg_dump and pg_basebackup