pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove function names from error messages
Date: Thu, 20 Dec 2018 10:21:45 +0900
Message-ID: <20181220012145.GG27104@paquier.xyz> (raw)
In-Reply-To: <13206.1545266551@sss.pgh.pa.us>
References: <E1gZg2W-0008Lq-0w@gemulon.postgresql.org>
	<20181219234103.GC27104@paquier.xyz>
	<13206.1545266551@sss.pgh.pa.us>

On Wed, Dec 19, 2018 at 07:42:31PM -0500, Tom Lane wrote:
> Those are at least reporting SQL function names that the user will
> recognize ... still, we don't normally localize error messages
> by the reporting function name, so I tend to agree that these are
> not following the style guide.

What do you think about something like the attached?
--
Michael

Attachments:

func-message-clean.patch (text/x-diff, 1.7K) download diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index c80b14ed97..c92f2a8e61 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -11077,7 +11077,8 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p) if (!reported_waiting && waits > 5) { ereport(NOTICE, - (errmsg("pg_stop_backup cleanup done, waiting for required WAL segments to be archived"))); + (errmsg("%s cleanup done, waiting for required WAL segments to be archived", + "pg_stop_backup()"))); reported_waiting = true; } @@ -11087,16 +11088,18 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p) { seconds_before_warning *= 2; /* This wraps in >10 years... */ ereport(WARNING, - (errmsg("pg_stop_backup still waiting for all required WAL segments to be archived (%d seconds elapsed)", - waits), + (errmsg("%s still waiting for all required WAL segments to be archived (%d seconds elapsed)", + "pg_stop_backup()", waits), errhint("Check that your archive_command is executing properly. " - "pg_stop_backup can be canceled safely, " - "but the database backup will not be usable without all the WAL segments."))); + "%s can be canceled safely, " + "but the database backup will not be usable without all the WAL segments.", + "pg_stop_backup()"))); } } ereport(NOTICE, - (errmsg("pg_stop_backup complete, all required WAL segments have been archived"))); + (errmsg("%s complete, all required WAL segments have been archived", + "pg_stop_backup()"))); } else if (waitforarchive) ereport(NOTICE,
signature.asc (application/pgp-signature, 832B) download

view thread (8+ messages)  latest in thread

Message-ID: <20181220012145.GG27104@paquier.xyz>
Permalink:  ../20181220012145.GG27104@paquier.xyz/
Also on:    postgresql.org/message-id/20181220012145.GG27104@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Remove function names from error messages
  In-Reply-To: <20181220012145.GG27104@paquier.xyz>
  References: <E1gZg2W-0008Lq-0w@gemulon.postgresql.org> <20181219234103.GC27104@paquier.xyz> <13206.1545266551@sss.pgh.pa.us> <20181220012145.GG27104@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox