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 1vAUqG-0029ch-VM for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 14:57:04 +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 1vAUqF-00B9qC-VU for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 14:57:03 +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 1vAUqF-00B9q4-Kp for pgsql-general@lists.postgresql.org; Sun, 19 Oct 2025 14:57:02 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vAUqC-00346S-0q for pgsql-general@postgresql.org; Sun, 19 Oct 2025 14:57:02 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id E1D9B1400028; Sun, 19 Oct 2025 10:56:58 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 19 Oct 2025 10:56:58 -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=1760885818; x=1760972218; bh=Zf7/lKGoRNf4+zn+wkoD6mPFWBga8ocDWtnEkBxdG0g=; b= aGU5Ej7gi2fpiGjb+fF7PSO5obBd24lmURVZhBsKMhSHKlAEg/oNoMtuEm7ophCP 1rh+RlQDFhzkun/Ht3Ft0ZjBDGv4i6tDEMCF8XJa0FPKhS4UR8Jo0BWuQ8GXwJrk 7pPtpGtVplCVIRApgOfnePOVE0dxBiEoIdGtS1DKzK32g6Uv5JgQNA5c/3HedomT uywmh52Aqimtf7jxOOrrLC0+MLvNIRYCoNKk3OPlTGB9rnk1TJrU/QlbnjHjRXqr GiJTyQLswoGssBU0JKIZXQZRRQwcE6mBivZZOVuu2/4Yqcg96untDSQZpGQfQzaP HjPvIZTfXt2Xl5QNMRRvhQ== 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=1760885818; x=1760972218; bh=Z f7/lKGoRNf4+zn+wkoD6mPFWBga8ocDWtnEkBxdG0g=; b=gHIP6igzjMVquILZy 6Gku6MdAOTdX2wewZyQ2WXtl9RMky1edhqHW9e/cMPCGdc+ikmX+T9LhrFW4g5kO lGs66yPK57SG90RdYwHXzCXcrriKMF4AlcDKImga/r2rMjmRcXpUVWdzztVmEV+a t+X0FSbiJuGYXXZwxnBW8ZmJG4CrLd3hgjUQcjpMc/v8cuSpJVI2c/3q4gxuFGJI iL6DcHRsRT9A2kxdDDGZvHkfOdUU1gEazCBf87kb5jpEvjL2SNLsTT+JZBpa1gGM /6zSC6uAEQ+XRwN/9qwRVg+4NR753TlBadq09/W7gtU8rnmYqTRVjmX3tm87xYYC oXwgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeehvdegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffhvfhfjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpefhudevueefveffjeeigeehffetteehjeevtedtgfdtfedv geejgfevvdefhfetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrshhhvghprg hrugesrghpphhlqdgvtghoshihshdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghn vghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Oct 2025 10:56:58 -0400 (EDT) Message-ID: <755cee02-f2c5-45b9-b90e-db80f2cd02fe@aklaver.com> Date: Sun, 19 Oct 2025 07:56:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Convert date and time colums to datetime From: Adrian Klaver 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 In-Reply-To: <6b30ebac-6d6d-4c26-be73-de67e208e4e1@aklaver.com> 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 On 10/19/25 07:53, Adrian Klaver wrote: > On 10/19/25 07:43, Rich Shepard wrote: >> The database has a table with separate date and time columns. >> >> 1. Are there benefits to merging the two into a single timestamp column? > > 1) One less column to fetch from. > > 2) If you really need a timestamp the work is already done, instead of > building on the fly. > >> >> 2. If so, how would I do this? (Reading date/time operators and functions >> doc page hasn't shown me one.) > > select ('10/19/2025'::date + '07:50'::time)::timestamptz; > > timestamptz > ------------------------ >  2025-10-19 07:50:00-07 Should have added in previous post, the above assumes your current date and time values are from the server timezone. > >> >> TIA, >> >> Rich >> >> >> > > -- Adrian Klaver adrian.klaver@aklaver.com