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 1gZn2H-0005gg-MC for pgsql-committers@arkaria.postgresql.org; Thu, 20 Dec 2018 01:22:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZn2F-0007RU-H0 for pgsql-committers@arkaria.postgresql.org; Thu, 20 Dec 2018 01:21:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZn2F-0007RM-7q for pgsql-committers@lists.postgresql.org; Thu, 20 Dec 2018 01:21:59 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZn28-0003Mp-GA for pgsql-committers@lists.postgresql.org; Thu, 20 Dec 2018 01:21:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CFABE22008; Wed, 19 Dec 2018 20:21:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 19 Dec 2018 20:21:50 -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=83d1S2dlWvOE1oE9a4H2LCgPkfr CaMjbwmNVYmmqNUQ=; b=f/wLISCnXL7KhDjjNQDYj3PCuskrnbiGGTlofDUa2m/ muDn0O9rKkH9setXFdYY5RPPhLYDE1mvpJYJvxuggiRvdhwqgipfOgEdbHx/hXhj xKTRVogPSDW4HT2AF4KsguAVtDn5DzXwYPgXa6cmc7HrsCszFD+n+vZJEdFAX2EY BNw5zz3Iww4Ne5IAMcIxZi+VoxEG7SSrjrPNWLGgmkYkQjLrIr9doWXRxL7L1co1 ZeocQ7aZ/LFuAK2zwSbOjTNNQ/AbF8CZoYkHcD4c3bDjzPkiuOH12f+POlfft8xw eZ3ZNFk7+GM66mMbHrQy/n4ZZ7kTDRbbJ3saQcf8TLQ== 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=83d1S2 dlWvOE1oE9a4H2LCgPkfrCaMjbwmNVYmmqNUQ=; b=Dr92dcZaxW+ZguJFtD4MV9 PT/DaNo5DMJpngd9gLRRGwwDxvi76nE99gzTJsKyiDxZ5XlvLZWbjYW4fq+dijec IYYElaDavqL0/OUVw+kIY/JQsaf45kceFmoSo44Eg9HUVNOUPXJjStilW41tli2g PfYQDcRFjSJKRIsBbKbXeEBkfb24H8/XNYnd6WVW3I+5qy83IO8Te+E+0WLzl098 V5wMVKrfvoXQWiFr90hsrIMr3nBrCN/W6//jwFh4Zy4nXIUREe/rTARzX4YQ43E4 uMXv0UQO27ykxmwmwlTu1ndOUocB5AD0Yd3a4KZRuHQ+kw9CCgJ4q+IJIYbVLr7w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudejvddgvdejucetufdoteggodetrfdotf 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 689A810087; Wed, 19 Dec 2018 20:21:48 -0500 (EST) Date: Thu, 20 Dec 2018 10:21:45 +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: <20181220012145.GG27104@paquier.xyz> References: <20181219234103.GC27104@paquier.xyz> <13206.1545266551@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xGGVyNQdqA79rdfn" Content-Disposition: inline In-Reply-To: <13206.1545266551@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --xGGVyNQdqA79rdfn Content-Type: multipart/mixed; boundary="nOM8ykUjac0mNN89" Content-Disposition: inline --nOM8ykUjac0mNN89 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --nOM8ykUjac0mNN89 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="func-message-clean.patch" Content-Transfer-Encoding: quoted-printable 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 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("%s cleanup done, waiting for required WAL segments to be ar= chived", + "pg_stop_backup()"))); reported_waiting =3D true; } =20 @@ -11087,16 +11088,18 @@ 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)", - waits), + (errmsg("%s still waiting for all required WAL segments to be archiv= ed (%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 s= egments."))); + "%s can be canceled safely, " + "but the database backup will not be usable without all the WAL s= egments.", + "pg_stop_backup()"))); } } =20 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, --nOM8ykUjac0mNN89-- --xGGVyNQdqA79rdfn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlwa7qkACgkQnvQgOdby QH11oxAAg/d7LsJycGNyVo6g9aH1qAmO13/1kgtnRhHm7RZ66QJzZRngdtjS/cFv ynq8v4eXYNAPlk9KONZoeL1wtbIqGV3IamCr9GovNKonm0mTjq30o19PTWHLDqrC zL6I+vyZEE0xB1AwoI8XEd+GMufhlex0IkZ0xw5AvdAXORSPLqL92JEaZ0dm2M3v RO9MCSNLZciAwvewTnb7EbSJcI/EVYtZxuEUQbXjcc0oWZGq8pc3hqcdix9RpmL9 IKF9pvF5dNPtVxrQYPYGiTB9/qadzP/CQnD9VjhsQGLFm393ez/rTCIG0f4SEzdT x3xf6JOvAVJ8pJetU1p1eo0KVCfAOStwBOQ9pfYhXtxtoRftTdYWjpYt6Q1RCRlL qU7DfDiHW98r9EsVInKRMVzNbO5ikMD5L2nW7Yfjd60cY43oTlE3ik58DE/Xtc47 LsnWzXbhsIj32YMbE//1aeAK6gkg46RpxX0TBt4QZG0NsTqqV6LmIFCnd6tKbHEp ornGS0ESyUAlIeS6JNjFDV1NfAGZcXjQhOICFAkAh428F891QuM/ONW1ybVKFEm5 575abSb/+trkNPQ/Jf9wBJqq4tC/NQv07KOsxl+ezr6ralAcL2Z3TN+Az0CbmI5v RpMz/oWLTHgr9t+CMyyMn2hXopu0fKcwdAtDat7pvZYaOfiXxjY= =AmgU -----END PGP SIGNATURE----- --xGGVyNQdqA79rdfn--