Re: Badly designed error reporting code in controldata_utils.c

From: Andres Freund <andres(at)anarazel(dot)de>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Badly designed error reporting code in controldata_utils.c
Date: 2016-03-07 01:26:21
Message-ID: 20160307012621.dszlz4cenjv6wobt@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-03-07 01:28:05 Re: The plan for FDW-based sharding
Previous Message Robert Haas 2016-03-07 01:19:41 Re: The plan for FDW-based sharding