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 1vAWl3-002e1o-Je for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 16:59:49 +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 1vAWl2-00BX04-Iy for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 16:59:47 +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 1vAWl1-00BWzv-HK for pgsql-general@lists.postgresql.org; Sun, 19 Oct 2025 16:59:47 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vAWkx-00352S-1A for pgsql-general@postgresql.org; Sun, 19 Oct 2025 16:59:46 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 157D4140010B; Sun, 19 Oct 2025 12:59:41 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 19 Oct 2025 12:59:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding: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=1760893181; x=1760979581; bh=JjmUET0xH3khSZ9Pjyb4Ekeozp5fmbIEzWuhH1TpCoY=; b= qeSIu4qIEhVTjxpwFaUnel/fFm83n4iMgvEd5wpMeuelHlDjpoWhk2PT8W81M11q wedMf/Ky71Nfg3K4UMpsOPo8qTY57XUUfTh7E6rKtviQEBqyPl3qA96tzsI0g2+D C89PrRX3fuh60F9nuT6xiIOEIigf2HWjgsiL3BHaqPL/7wt5DSO2LSmiMXfyPmtF qULTWjkYu0+jqFiP78lDlkZf4eYTiypxWtTXmR2FPQx3/X2gSMWa1xHZlk2ktxkP RhuAmjtsTbtqi0kbjPY2tf5ls4OwCDSOoW4nPKWwsgLBwYUtWG0uSratHW9YlxA7 0FAD7PrFEPtZbkshynBaDQ== 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: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=fm2; t=1760893181; x=1760979581; bh=J jmUET0xH3khSZ9Pjyb4Ekeozp5fmbIEzWuhH1TpCoY=; b=Dn4HWTlB327ayC8q/ +Kv8BTveRiwS7oGA4bv5mmm3CCfwu7fUZfe8VHbpoDz4Fk7SsGWe2ZXThEv6yxmD qygDTxDrMlMdzETtUyC1feYVftbstwL3wEB5VLRztcwLiElDCI57lLi7JU7C5bwX Zg4BNHkUMTBKwdK3TjuWv5MyvolCFvcX+yMEnl4o04v7hxPs2B+pNsDiiPWntBER xFKgwF7Jv5CIrVYWeiJ0/3uYVbcHNXYX1X0vN9zdJUi+L63/DGVnGF9SCFyjuMSb y7fkJnnAxYY51XKCRONWIBK+xSy3IuoN0kRJ/ZkZY12Z/eDNqg+BE9rKoTd+aplc w08yA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeehgeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeeivdfhieehheegueeileejieettdejhedugeefleekvdel keehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrshhhvghprg hrugesrghpphhlqdgvtghoshihshdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghn vghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Oct 2025 12:59:40 -0400 (EDT) Message-ID: <4729a93e-7d39-4837-8e9b-8ecc2e628b81@aklaver.com> Date: Sun, 19 Oct 2025 09:59:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Convert date and time colums to datetime To: Rich Shepard , pgsql-general@postgresql.org References: <63dfbc7c-bc63-7fa-a51b-915dd804ea2@appl-ecosys.com> <6b30ebac-6d6d-4c26-be73-de67e208e4e1@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/19/25 09:35, Rich Shepard wrote: > On Sun, 19 Oct 2025, Adrian Klaver wrote: > >> 2) If you really need a timestamp the work is already done, instead of >> building on the fly. > > Adrian, > > As each row in the table already has both a date column and a time column I > don't know if I 'really' need a timestamp. When would a timestamp be really > needed? I would say the fact you are asking is an indication you might need it. > >> select ('10/19/2025'::date + '07:50'::time)::timestamptz; > > Yes, I saw that on the doc page. This requires manually changing each > row in > the table rather than using a date/time condition/function to to create the > single timestamp column. So, apparently there's not a way to modify the > table other than by hand. 1) Again you seem to be establishing a need for combined value. 2) Not sure how you do "...date/time condition/function to to create the single timestamp column" without creating a column? If you meant creating a timestamp value then I point you at my original post and: "2) If you really need a timestamp the work is already done, instead of building on the fly." Doing the one time change to add a timestamp field to the table and then do the UPDATE of date + time to populate it versus calculating it every time you need the value. Of course moving forward you would need to change the code that INSERTs new values to use a timestamp instead of a date and a time value. > > Thanks, > > Rich > > -- Adrian Klaver adrian.klaver@aklaver.com