Re: Badly designed error reporting code in controldata_utils.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Badly designed error reporting code in controldata_utils.c
Date
Msg-id 20160307012621.dszlz4cenjv6wobt@alap3.anarazel.de
Whole thread Raw
In response to Re: Badly designed error reporting code in controldata_utils.c  (Joe Conway <mail@joeconway.com>)
Responses Re: Badly designed error reporting code in controldata_utils.c
List pgsql-hackers
On 2016-03-06 17:16:42 -0800, Joe Conway wrote:
> - #ifndef FRONTEND
> - /* NOTE: caller must provide gettext call around the format string */
> - #define log_error(...)    \
> -     elog(ERROR, __VA_ARGS__)
> - #else
> - #define log_error(...)    \
> -     do { \
> -             char *buf = psprintf(__VA_ARGS__); \
> -             fprintf(stderr, "%s: %s\n", progname, buf); \
> -             exit(2); \
> -     } while (0)
> - #endif
> -

FWIW I'm considering implementing elog/ereport properly for the
frontend.  We've grown several hacks around that not being present, and
I think those by now have a higher aggregate complexity than a proper
implementation would have.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: The plan for FDW-based sharding
Next
From: Robert Haas
Date:
Subject: Re: The plan for FDW-based sharding