Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKo5B-00AtLC-Jk for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2024 00:26:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tKo57-00DEs2-Hn for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2024 00:26:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKo57-00DErd-7q for pgsql-bugs@lists.postgresql.org; Tue, 10 Dec 2024 00:26:30 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKo55-001ydH-9U for pgsql-bugs@lists.postgresql.org; Tue, 10 Dec 2024 00:26:29 +0000 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 814182540158; Mon, 9 Dec 2024 19:26:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 09 Dec 2024 19:26:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1733790385; x=1733876785; bh=O4fimsU+TZ 8RuG7UVzF1iIunlZQ6qSE4lBDPsep7LX0=; b=IhPA3DQVVGht1m0TS0sACq8nHs 4PXXHi+A5XgHMXChxVfyf3PkHBe0YZo/+gmgVnb7pTcuWyFBV0KuoPWlRchV0BHn ZLadEdgpuu4BoALg672lR84DCwH0Nfy0yVgVXAohkWBJbTKykL01FCGQcXxaiDt4 D1+xVpEJsk5SBoa12NlHpCAuptuSUAt7OEZ7apGPlTyYsbvlssvRiF/HugoYb1ZG pGZFwqaeVItxOwMpKtu0RddI48mkeHgJO/VU3H16RWy84c3avRPXygtMOpqUbna1 ECQwlXrpo7ZDRms1tb6Q9ZkagGeoi67KbGY7v8XXOKNNtQlPuCNgJRHHqbAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1733790385; x=1733876785; bh=O4fimsU+TZ8RuG7UVzF1iIunlZQ6qSE4lBD Psep7LX0=; b=nuFjIz602N+GkusEZor7yBvE0D9hMc0gBuSVt9W00RSxeI3nEPY mLyB8EcuhFAGdoWpoEFfyScOgZjjPWTx30cO7RTfXtzCU54rwi07378IFLajfPh0 iuUyTmy/mEEK79FEj3UEisQrOQB2+VygBQVah5ezhiUzTT9OPV8ROXn88R98RWJ+ Y7HWMZY1qyDr78ugVGCnytueWAOo5Qk3Yvz8/xmpAzd3wp7Zli7opIkyK6/SzHdD XRIfvqaK2bW0GEDJnaLSnGF1Bt4+clNiPlcs3UsdLEKtP3SMDJau0N/ziDVxKnnJ 3FqBjnZRhee+I4VSdsCT6toqWVDXHfObTyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrjeejgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleei fedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehp rghquhhivghrrdighiiipdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegrlhgvkhhsrghnuggvrhesthhimhgvshgtrghlvgdrtghomhdprhgt phhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorh hgpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Dec 2024 19:26:23 -0500 (EST) Date: Tue, 10 Dec 2024 09:26:02 +0900 From: Michael Paquier To: Aleksander Alekseev Cc: pgsql-bugs@lists.postgresql.org, Tom Lane Subject: Re: TimestampTz->Text->TimestampTz casting fails with DateStyle 'Postgres' Message-ID: References: <3416600.1730987836@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tFij9YOcvheKyeUQ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --tFij9YOcvheKyeUQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 07, 2024 at 06:09:15PM +0300, Aleksander Alekseev wrote: > Here is the patch. @@ -139,6 +139,7 @@ static const datetkn datetktbl[] = { {"july", MONTH, 7}, {"jun", MONTH, 6}, {"june", MONTH, 6}, + {"lmt", IGNORE_DTF, 0}, /* "lmt" (throwaway) */ {"m", UNITS, DTK_MONTH}, /* "month" for ISO input */ {"mar", MONTH, 3}, {"march", MONTH, 3}, FWIW, I have a hard time understanding why ignoring "LMT", which is a timezone abbreviation meaning "Local Mean Time", in datetktbl[], which is a table for date/time keywords, is the right thing to do. The comment at the top of datetktbl also mentions that this includes no TZ, DTZ, or DYNTZ entries, and that we should rely on zoneabbrevtbl instead, which is pushed by InstallTimeZoneAbbrevs() depending on the GUC assign callback of timezone_abbreviations. So that seems just inconsistent to me. Perhaps that's OK at the end, but this ignores the existing comment on top of the table. Worth noting that we may want to do something in ECPG's dt_common.c as well, that holds a similar table with TZ abbreviation data and LMT is missing there? -- Michael --tFij9YOcvheKyeUQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmdXipoACgkQnvQgOdby QH1hbQ//fItwZeqs5czBZSfpquhCQPTBoQui0C2bvQAB61RuQLqudQ9RpDEU7M8E CmBu3Rir2hWjBaIJwgQFOcXsArmxlrp6TUMZ9eF3C6n99nbjwyKRcR+YirZe9knf 34TeQZlQWBiwMa0w2lqm45cKMEyGGD4JgaSpoNGpEU7wjjP3a4knZ3MDFudpNEwK +UysZ8mvDS/Lv0Jksrjr4VPfgd2hUjt9kBtQU0EZJRvUxWkWfUGBgNqTJDP3HsOH azp9a58/eTWgBGCumhNHS/pt2wfAXfeQ25YBxSxoZv6lwuRim0kLqUG7ojvJqN6M +3vlgutsotQ3PdA4+QI9MrWEXEd5PZciWqtqf9tLkpJYPoXxAYMVuVpyi/HRirrk x363O5G8VI0VQFsAXOqTADKpb+7h18kqUUTSqTFBlT0KZlqlbNl+qPRV1MRW48R5 tuzEEapwwGZoMUXwkwWQejK7UKQKB8gw8tsi76AeYaz2ecDEjIC2+6yarzGaY9O8 PVt6HHROh+KMOXZEk7ifnKrfhF/muzsKjupSxJTkDryU+AytbCfG4bZ099p+pzQf pj8HjKW9jPvm8DZqtztoZ29GkyUaXltVA5or9YmV9Gs99At3m77zfHCbjZUT9jA1 tZSrdiRoaYoaKvInZKtR0SPxlB2wwN4T8OO5YwHLmIRKaJz6wwQ= =8YX2 -----END PGP SIGNATURE----- --tFij9YOcvheKyeUQ--