pgsql: Add errhint_internal() - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Add errhint_internal()
Date
Msg-id E1tyzGt-001oaN-0D@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add errhint_internal()

We have errmsg_internal(), errdetail_internal(), but not errhint_internal().

Sometimes it is useful to output a hint with already translated format
string (e.g. because there different messages depending on the condition). For
message/detail we do that with the _internal() variants, but we can't do that
with hint today.  It's possible to work around that that by using something
like
  str = psprintf(translated_format, args);
  ereport(...
          errhint("%s", str);
but that's not exactly pretty and makes it harder to avoid memory leaks.

Reviewed-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/ym3dqpa4xcvoeknewcw63x77vnqdosbqcetjinb2zfoh65k55m@m4ozmwhr6lk6

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4244cf68769773ba30b868354f1f2fe93238e98b

Modified Files
--------------
src/backend/utils/error/elog.c | 21 +++++++++++++++++++++
src/include/utils/elog.h       |  1 +
2 files changed, 22 insertions(+)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing
Next
From: Andres Freund
Date:
Subject: pgsql: bufmgr: Implement AIO read support