Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZrI5-0001lz-QN for pgsql-committers@arkaria.postgresql.org; Thu, 20 Dec 2018 05:54:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZrH6-0004Uv-3l for pgsql-committers@arkaria.postgresql.org; Thu, 20 Dec 2018 05:53:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZrH5-0004Uo-U7 for pgsql-committers@lists.postgresql.org; Thu, 20 Dec 2018 05:53:35 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZrH3-00010s-OS for pgsql-committers@lists.postgresql.org; Thu, 20 Dec 2018 05:53:35 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5BC1A20B58; Thu, 20 Dec 2018 00:53:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 20 Dec 2018 00:53:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=YmFZR0xFrATgIKYaHSp5o3JaLk+ oULDSzZIQG5WPlec=; b=DRi1oSlykt8C5smRRK1hw6iWVPqD7Wtyj0N8p1uWvFs qdYVSZVx9RO+pH81eCd9Ldo29emTBEi/TfCtzmdYXkEvtqfxjiXuliVcppghYpX8 ianhk78T7o6oMlO/n/NcggJVX2vJeWo9c6DjJCJ6A3LoqmIfKXLhubpLjHUKeql9 Q85DJDZaOadJ8hWpz729fApd6eh/uhDEOYA5cbK2X8tQJUsdnQ4FWq6UmDTz7GLz qAlFlcqIZAhqC1ZBf6viNAeG/QpCyAoCFd5xQ4gSZBhacrLTeajQDPjV/q0zRCk6 TV35eqfd+UbYn42gzcLkwp1njqV4u+R2SUQ51OLlzxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=YmFZR0 xFrATgIKYaHSp5o3JaLk+oULDSzZIQG5WPlec=; b=S/uw8iJWT5L5KSKpQIfGyw SfJ8/uvId5rq/WgrbQ9ED4raT8wyDygKKQBCKolgLgqlVlAuY4H9L5JLXTcUGjRd GF6VlmKBdoSFhTghLKrS3PwAl9ecN3jOAuvR08e1iFAzAtRnGL1nUtZ4SFwIBB2M k9FGZFRCXInRuIwhzYsgvuBgp0KUAr3R6QuSMskLxMzx9BcJKULOthPeAMZ9fCGb 7qHKgUc+0MjIaJWNuTBetu6zkkZ1meMyCv14ErEx6O2yDbc9Pq5h9fVSx65nb7vb dzA6FcEaa2EDIUqWkpWzW+9ku6In6nziMRwoMkI+VokHR4j2P5IvE46dcDqOk6Cw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudejvddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtd dmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgt hhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqne cukfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 758E3100B8; Thu, 20 Dec 2018 00:53:29 -0500 (EST) Date: Thu, 20 Dec 2018 14:53:26 +0900 From: Michael Paquier To: Tom Lane Cc: Alvaro Herrera , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Remove function names from error messages Message-ID: <20181220055326.GP27104@paquier.xyz> References: <20181219234103.GC27104@paquier.xyz> <13206.1545266551@sss.pgh.pa.us> <20181220012145.GG27104@paquier.xyz> <22053.1545280763@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XMM+kVNHGkMezEqK" Content-Disposition: inline In-Reply-To: <22053.1545280763@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --XMM+kVNHGkMezEqK Content-Type: multipart/mixed; boundary="v4cNTr+tRGSs1txX" Content-Disposition: inline --v4cNTr+tRGSs1txX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 19, 2018 at 11:39:23PM -0500, Tom Lane wrote: > Hm, I guess I shouldn't have used the word "localize". I didn't > mean whether the function name should be translated; what I meant > was that we normally don't mention individual functions at all in > error messages. The messages are supposed to be written as though > a monolithic entity "the system" is speaking to you. So what > I'd propose here is just >=20 > ereport(NOTICE, > (errmsg("waiting for required WAL segments to be archive= d"))); >=20 > or something along that line. I'm not sure if the "cleanup done" part > is important, but I'd tend to the idea that it isn't. Okay. The cleanup part is roughly about the work of putting all the shared variables back to an initial state, so indeed that does not matter much to remove this part. =20 While at it, I am tempted to rework a bit the comments at the top of do_pg_start_backup and do_pg_stop_backup as those are not only used for the SQL-level interface but can also be used for base backups taken with the replication protocol. The WARNING about the segments not archived yet should not mention directly pg_stop_backup as well as BASE_BACKUP never calls it. -- Michael --v4cNTr+tRGSs1txX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="func-message-clean-v2.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam= /xlog.c index c80b14ed97..57b5a91f96 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -10163,9 +10163,10 @@ XLogFileNameP(TimeLineID tli, XLogSegNo segno) } =20 /* - * do_pg_start_backup is the workhorse of the user-visible pg_start_backup= () - * function. It creates the necessary starting checkpoint and constructs t= he - * backup label file. + * do_pg_start_backup + * + * Utility function called at the start of an online backup. It creates the + * necessary starting checkpoint and constructs the backup label file. * * There are two kind of backups: exclusive and non-exclusive. An exclusive * backup is started with pg_start_backup(), and there can be only one act= ive @@ -10705,8 +10706,10 @@ get_backup_status(void) } =20 /* - * do_pg_stop_backup is the workhorse of the user-visible pg_stop_backup() - * function. + * do_pg_stop_backup + * + * Utility function called at the end of an online backup. It cleans up the + * backup state and can optionally wait for WAL segments to be archived. * * If labelfile is NULL, this stops an exclusive backup. Otherwise this st= ops * the non-exclusive backup specified by 'labelfile'. @@ -11077,7 +11080,7 @@ do_pg_stop_backup(char *labelfile, bool waitforarch= ive, TimeLineID *stoptli_p) if (!reported_waiting && waits > 5) { ereport(NOTICE, - (errmsg("pg_stop_backup cleanup done, waiting for required WAL segme= nts to be archived"))); + (errmsg("waiting for required WAL segments to be archived"))); reported_waiting =3D true; } =20 @@ -11087,16 +11090,16 @@ do_pg_stop_backup(char *labelfile, bool waitforar= chive, TimeLineID *stoptli_p) { seconds_before_warning *=3D 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)", + (errmsg("still waiting for all required WAL segments to be archived = (%d seconds elapsed)", waits), errhint("Check that your archive_command is executing properly. " - "pg_stop_backup can be canceled safely, " + "Backup can be canceled safely, " "but the database backup will not be usable without all the WAL s= egments."))); } } =20 ereport(NOTICE, - (errmsg("pg_stop_backup complete, all required WAL segments have been = archived"))); + (errmsg("all required WAL segments have been archived"))); } else if (waitforarchive) ereport(NOTICE, --v4cNTr+tRGSs1txX-- --XMM+kVNHGkMezEqK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlwbLlYACgkQnvQgOdby QH3BrQ/+MlejJmAbbJZpQ1nzMjwuOXRbDHwNYND3wWrXcW57OI4NVlYhE+yb9wcs 0a9bwZIN62vXAtaUnYJEUYi7sNe9Znyg73NPBFIDfuZ/6SQMSAcZh3y1Z/4oFIj0 +JxsXYALJ87LRLIHANRBedLLYJFmGnNhV+2nUGnBJB9cEAOJLb8Uyf5D8jh+w0vR regZWP1YtU3sZeRKjHtpeiw+/GY6y4ZXYxfArHTq/TxJRh/kpeZCjlTySexVAadU /zv3AV8Cdl3KRUazo2NFL0HwIUiZdLUDBA8rGgSo6PHDlQjt3APotHkokIpgMQ23 iU7OM5YgcD2Az+kPf11iffmbPswfdUMzyT+UffUVk3iEnQhZnEpLM3y4Xsp1Aqji 5eucjodL9RiWXOu2uFTq+QdImvH9+eBqP3FaZpDaXjPEVWqGxaqAji3ZtIgmHDk3 39US8irey6YDhFVvorJY5cvAgWjQvUk3Ypfgsb3w7pYO719ueOECsTDcQx4oadjH 4BHhfLrkO85avpiiUEbOIaHBDHZPitjReYHuI06sB7Ch0/06N/okJstHHNXZTmb7 DOh7PqLs9FRP778dYfPzKf31q7R/jsaEytS1K2nCmMhQLkeWv1JhV5Kf5LS2uzRo qyFiKoHpUeuT9c/P5A3GNgD2+gAxgawdLZIzlzxs5gTgZ7rpAI4= =9QQs -----END PGP SIGNATURE----- --XMM+kVNHGkMezEqK--