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 1tJe4Y-004Lyy-QU for pgsql-admin@arkaria.postgresql.org; Fri, 06 Dec 2024 19:33:07 +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 1tJe4U-00DW5X-3g for pgsql-admin@arkaria.postgresql.org; Fri, 06 Dec 2024 19:33:03 +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 1tJe4S-00DW5P-Nu for pgsql-admin@lists.postgresql.org; Fri, 06 Dec 2024 19:33:02 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJe4M-001OYe-Tt for pgsql-admin@lists.postgresql.org; Fri, 06 Dec 2024 19:33:00 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8150C1140110; Fri, 6 Dec 2024 14:32:53 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Fri, 06 Dec 2024 14:32:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1733513573; x=1733599973; bh=PKd3ZwalIPoGzvTnGnlDkBmHCYULPpvE jC5EOZVPbGQ=; b=aU+JH3myNQUnUZ50UMWz/TpMInYeY+5vBMnbMAU1ZlH9Ad0R htvm0d6KnpO/YJN5PgFimtvMnX4oblT1W61umM10fxJeNDmD3zJ+3J+Jv2VgiATx ATkjwXBZWqj/2qBQS9dzUepKtG9tTveqFPVVZB69FIpyQl4al7O6PjNxxQW5sDGa PQpkrlEbfll1TMJ2UYXFnqa20/gW4lZMZhsLYI9vwKnRcgIRzfxp/AyxGbSB0RkK Ks0MkCDp6mnvjvvZMqnqGkUbvVWyDByYLmxhTCkI4lva8MUVvwaQSLx/NOuIlgGb B5D1oyKPs1QcHG+tiOYHNRAbIb6B6kOcBHax0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1733513573; x=1733599973; bh=PKd3ZwalIPoGzvTnGnlDkBmHCYULPpvEjC5 EOZVPbGQ=; b=aBIMpYCYKVabV+5tqdxVcMQuf5vpGhLUm1qj8tnnWraOuklrFPJ 72fC5iETS1dUtMdopBB5Mn7MchQYbEjPX+IVLoxJeksxhvWdzEkdt8773A16pw9k f+bGo7R1ISB+7BHqEujnuxcmG609qxS8EJeoitIjJ/SbuDrNKMt1qx4WF4lFaAWy nOwhC7lKDD4HQkRP7R6NXdhqfRV4/gUlHZ+Rp43PqO+ro+FdSrkCN04hSk+ikcWJ oV0cKk7gAC8/Mfv8iYE0nDCqiu1X21lST6duh5U/jyO6t2xQiFxO7syBaCgHRM3T RQYFa5bXJX9dRl7bSy/jyb+p/WZ5O9LML6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieelgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fvhffutgfgsehtkeertddtvdejnecuhfhrohhmpefusghosgcuoehssghosgesqhhurggu rhgrthhumhdqsghrrggttggrshdrtghomheqnecuggftrfgrthhtvghrnhepfeekhefftd ffleduudegkeevtdekvdejgfegheefteefudeiveekhfelfffhuefhnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrg htuhhmqdgsrhgrtggtrghsrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopehpghhsqhhlqdgrughmihhnsehlihhsthhsrdhpohhsth hgrhgvshhqlhdrohhrghdprhgtphhtthhopehssghosgesqhhurggurhgrthhumhdqsghr rggttggrshdrtghomh X-ME-Proxy: Feedback-ID: i374947ac:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 Dec 2024 14:32:52 -0500 (EST) Message-ID: Date: Fri, 6 Dec 2024 12:32:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: "pgsql-performance@lists.postgresql.org" Content-Language: en-US From: Sbob Subject: time data type question Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk All; I am testing a planned change for a table in our db - PostgreSQL 14 I created a table like this: create table alter_test4 (id int, active_ts timestamp without time zone, active_time time without time zone); I set my current timezone is set to Central Time: postgres=# set timezone = 'US/Central'; SET Then I inserted some rows: postgres=# insert into alter_test4 VALUES (1, now() - interval '14 days' , now() - interval '1 hours'); INSERT 0 1 postgres=# insert into alter_test4 VALUES (2, now() - interval '4 days' , now() - interval '7 hours'); INSERT 0 1 postgres=# insert into alter_test4 VALUES (3, now() - interval '1 day' , now() - interval '4 hours'); INSERT 0 1 postgres=# select * from alter_test4;  id |         active_ts          |   active_time ----+----------------------------+-----------------   1 | 2024-11-22 13:24:20.675575 | 12:24:20.675575   2 | 2024-12-02 13:24:29.136082 | 06:24:29.136082   3 | 2024-12-05 13:24:40.346881 | 09:24:40.346881 (3 rows) Then I altered both the active_ts and the active_time column data types  to include time zone postgres=# ALTER TABLE alter_test4 alter column active_ts set data type timestamp with time zone; ALTER TABLE postgres=# ALTER TABLE alter_test4 alter column active_time set data type time with time zone; ALTER TABLE Now a select shows the timezone offset: postgres=# select * from alter_test4;  id |           active_ts           |    active_time ----+-------------------------------+--------------------   1 | 2024-11-22 13:24:20.675575-06 | 12:24:20.675575-06   2 | 2024-12-02 13:24:29.136082-06 | 06:24:29.136082-06   3 | 2024-12-05 13:24:40.346881-06 | 09:24:40.346881-06 (3 rows) However, if I change my timezone and re-run the select only the timestamp columns reflect the new timezone, the time columns remain the same: postgres=# set timezone = 'America/Denver'; SET postgres=# select * from alter_test4;  id |           active_ts           |    active_time ----+-------------------------------+--------------------   1 | 2024-11-22 12:24:20.675575-07 | 12:24:20.675575-06   2 | 2024-12-02 12:24:29.136082-07 | 06:24:29.136082-06   3 | 2024-12-05 12:24:40.346881-07 | 09:24:40.346881-06 (3 rows) I thought I would see the time columns shift to mountain time as well. am I doing something wrong? Thanks in advance