Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUkCx-0008G7-W0 for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Sep 2022 07:38:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oUkCw-000705-IU for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Sep 2022 07:38:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUkCw-0006zw-93 for pgsql-hackers@lists.postgresql.org; Sun, 04 Sep 2022 07:38:18 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUkCt-0006By-NB for pgsql-hackers@lists.postgresql.org; Sun, 04 Sep 2022 07:38:17 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 943915C00A8; Sun, 4 Sep 2022 03:38:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 04 Sep 2022 03:38:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1662277094; x=1662363494; bh=+ 9QU+p+cJrnp8u88JeEqHeemahzGOi5b40YtwNyaHIo=; b=0T0puDB2/J2xJvYPB E5DxzvfCONfnJYk57Gu8bZmEHQlCA7A8frYe6sy0nH7j7UV++m9KN4MTtCwBLGB5 x0mjH7XQgxGcOrgzLyxXd8bze47gNkDdEYgwLOAaQVuSL6qJeGZq7NjI4JbXAj9o i9xhZK1abtDoDVkZlzhpd216kUAzIKZNK4l1SlpAKonJkNfIRCyXnzRWyAiFDCta 4cOzbgk2kcajhokI2/Pw8k14Fz87gz4VJxbd3AVfWpJgxTWvfmE30eUbrE3aKOk3 M0FNQo2279F9NXoyOQwSwx3DM9yynRT/TmCb2E2qwZyr0PE0KIYY4UNqxzkhPr6A MsJYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdelfedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 4 Sep 2022 03:38:13 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0450837D; Sun, 4 Sep 2022 09:38:33 +0200 (CEST) Date: Sun, 4 Sep 2022 09:38:33 +0200 From: Alvaro Herrera To: Thomas Munro Cc: Peter Eisentraut , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: pg_collation_actual_version() -> pg_collation_current_version(). Message-ID: <20220904073833.oi56o5nqbs6hrf6y@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Feb-26, Thomas Munro wrote: > On Thu, Feb 25, 2021 at 10:49 PM Peter Eisentraut wrote: > > Seeing that explanation, I think that's even more of a reason to avoid > > the name "current" and use something strikingly different. > > > > In any case, this function name has been around for some years now and > > renaming it just for taste reasons seems unnecessary. > > I guess my unspoken assumption was that anyone using this in a query > is probably comparing it with collversion and thus already has a query > that needs to be rewritten for v14, and therefore it's not a bad time > to clean up some naming. But that argument is moot if you don't even > agree that the new name's an improvement, so... reverted. 18 months later I find myself translating this message: #: utils/init/postinit.c:457 msgid "template database \"%s\" has a collation version, but no actual collation version could be determined" and I have absolutely no idea what to translate it to. What does it *mean*? I think if it does mean something important, there should be a "translator:" comment next to it. However, looking at get_collation_actual_version, I think returning NULL is unexpected anyway; it appears that in all cases where something failed, it has already reported an error internally. Also, several callers seem to ignore the possibility of it returning NULL. So I wonder if we can just turn this ereport() into an elog() and call it a day. The word "actual" is very seldom used in catalogued server messages. We only have these few: msgid "template database \"%s\" has a collation version, but no actual collation version could be determined" msgid "could not determine actual type of argument declared %s" msgid "RADIUS response from %s has corrupt length: %d (actual length %d)" msgid "ShmemIndex entry size is wrong for data structure \"%s\": expected %zu, actual %zu" msgid "could not determine actual enum type" msgid "collation \"%s\" has no actual version, but a version was recorded" msgid "could not determine actual result type for function \"%s\" declared to return type %s" msgid "database \"%s\" has no actual collation version, but a version was recorded" and my strategy so far is to translate it to "real" (meaning "true") or just ignore the word altogether, which gives good results IMO. But in this particular it looks like it's a very critical part of the message. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "No me acuerdo, pero no es cierto. No es cierto, y si fuera cierto, no me acuerdo." (Augusto Pinochet a una corte de justicia)