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 1t930k-007Rd8-E6 for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 13:57:21 +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 1t930h-00FwaT-3m for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 13:57:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t930g-00FwaJ-Ro for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 13:57:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t930e-000dku-VL for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 13:57:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4A7DvG4R3416601; Thu, 7 Nov 2024 08:57:16 -0500 From: Tom Lane To: Aleksander Alekseev cc: pgsql-bugs@lists.postgresql.org Subject: Re: TimestampTz->Text->TimestampTz casting fails with DateStyle 'Postgres' In-reply-to: References: Comments: In-reply-to Aleksander Alekseev message dated "Thu, 07 Nov 2024 11:32:30 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3416599.1730987836.1@sss.pgh.pa.us> Date: Thu, 07 Nov 2024 08:57:16 -0500 Message-ID: <3416600.1730987836@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Aleksander Alekseev writes: > =# set datestyle to 'Postgres'; > SET > =# SELECT '1000-01-01'::timestamptz::text::timestamptz; > ERROR: invalid input syntax for type timestamp with time zone: "Wed > Jan 01 00:00:00 1000 LMT" > If I understand correctly, text->timestamptz doesn't understand the > 'LMT' timezone. So it seems. In a quick experiment, it seemed like just treating LMT as a noise word on input might be enough, but I don't have time today to poke at it further. regards, tom lane