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 1vApEd-006Lif-W4 for pgsql-general@arkaria.postgresql.org; Mon, 20 Oct 2025 12:43:35 +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 1vApEc-00HQls-V8 for pgsql-general@arkaria.postgresql.org; Mon, 20 Oct 2025 12:43:33 +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 1vApEc-00HQlj-Kf for pgsql-general@lists.postgresql.org; Mon, 20 Oct 2025 12:43:33 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vApEZ-003EEo-0f for pgsql-general@lists.postgresql.org; Mon, 20 Oct 2025 12:43:33 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-782bfd0a977so3113234b3a.3 for ; Mon, 20 Oct 2025 05:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760964209; x=1761569009; darn=lists.postgresql.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=mqpH9OdSPg8NDOhV0DVEdQ7i78osichdgnwg9DpZuwY=; b=b+tjiQEPza+XTLOG3mQ36bPXM63Y7oi1gBmPJSI/H/Q8BMAeRJaE/ZoFvHZRFmU9Ht pGEXhLSzZxyOPdPtbfTj3ku/mbH+fdGVhJTHb2Sge4hXMROkqayyCjsfvYLTwCwFKGp9 RVpSMGmYEKZcoZ8NrjleGOLd7jKkzfXv3wsNDE5pwtacrt9IIYxSJGKdkafx/9yyrDHN Vx2rSJr+iH67MO1KrWU1aef1GSuO/mpltOTIZui0/JgDWH6zZ3ApECd+XNKSKqILfsIX lUXgZj1T05va2ie13EMe926K40Ub4u3rO1YquX7feLMvfLsDEtx2WvLzbgmODQrJVxWq Kndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760964209; x=1761569009; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mqpH9OdSPg8NDOhV0DVEdQ7i78osichdgnwg9DpZuwY=; b=IAPYBW6/xCO0WSnOWMKeSibWGmop39TtWloWFCD9AC+HSyJh5GNnH5H8joaRv+D9od KXh5RfoyNKTgwGwxCA0yyJupWRsQHDFkuYQg3W8r+iJEISex4bCnXNGlHD7yizRnbtWC xx4+lUYk9UI610wHKZhkAQFdeEq7CsNvEtdg0OH42xIzpUCl7I9gZqjjCagA0q/FEfT3 5+Ys2tuY6pxScJoo5Xh8GDK6oguqHxHThGhDmWsFPw+LMXzYdBQzrTSXQ9mACezuUFMH gq7GLBmVO464YfGMjjUbiDIzA2O2QkdHowp25+iN0FxIogUiD34zBb90N1Y0StT5KfGO zDsg== X-Gm-Message-State: AOJu0YxGxAhqa6zJqo1YECCItvmfxTYNUSEuw6Y+cr8ulFSRH9pVrlbI 6zMe8ao7enkqcljzLehxGoYfp2Hikn7QQ0HanRPNT8OkpJ4nU0EeOu07YCyvuzGo X-Gm-Gg: ASbGnctkf8RQcyu4HwN9jYn44TVxRAgSMYZ1NAC+tk/zl/M+Feg3RFzVvVfX+Wijc3p qySa2kmiVQNTMY9dAVutLS3iIYAinZ7w1e0fXvkTzE47mCcjVQRmLw2QsW/8LmEycj7onPL3SuN jNBRFhtYwiUiOfgC5SLqZXqz6DsBnh+kU+dGt55Wj5Vf1ZbCTbbKCQNzUD+bT1TTUJ9e0KFXiph Z+njFMR/C6c1OLcu8U6XxJW6r4DbDuPPUQg2BGZdey9xsglUzmXy8wMKioSxKPC08WkZddj2ZvY wTbhkZakC13xCQRxufK5lOYsRS7fPKPmlephHG3WHM+HdKTi8Aij1mPcFhBd0GiVeRghzCALoBb mXqnTSd4nQO2L03Lvf2pP/AaNRdp7vZgMjhEZWiUOr/4EsI5oT94tPEpzP6obbBxyAmmxC4p+T8 TZLxsf5QeG5DaeCuucZYx9MmV/J3A= X-Google-Smtp-Source: AGHT+IGsOzDbeyfBF3lZYU37tD69C1942AlxrgiyiqNyh7vz9yVq20gGJcllOMKvS6IsMRG/r+zYIw== X-Received: by 2002:a05:6a20:3945:b0:252:2bfe:b65a with SMTP id adf61e73a8af0-334a8523c3dmr16629271637.7.1760964208729; Mon, 20 Oct 2025 05:43:28 -0700 (PDT) Received: from smtpclient.apple ([15.220.16.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a230121f96sm8246466b3a.76.2025.10.20.05.43.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Oct 2025 05:43:28 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Rob Sargent Mime-Version: 1.0 (1.0) Subject: Re: Convert date and time colums to datetime Date: Mon, 20 Oct 2025 06:43:17 -0600 Message-Id: <9EF7C4D5-613B-42DE-9FBD-1D14B452DA29@gmail.com> References: <3cq7x5ky2pn2jabsx7bg67b4c34aijnhxc5ewpgmfot73vftd5@pjlqjnh47ymt> Cc: pgsql-general@lists.postgresql.org In-Reply-To: <3cq7x5ky2pn2jabsx7bg67b4c34aijnhxc5ewpgmfot73vftd5@pjlqjnh47ymt> To: "Peter J. Holzer" X-Mailer: iPhone Mail (22G100) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Oct 20, 2025, at 5:05=E2=80=AFAM, Peter J. Holzer wr= ote: >=20 > =EF=BB=BFOn 2025-10-19 20:32:07 -0600, Rob Sargent wrote: >>>> On Oct 19, 2025, at 2:38=E2=80=AFPM, Rich Shepard wrote: >>> On Sun, 19 Oct 2025, Rob Sargent wrote: >>>> I think you have to ask why those values were separated in the first >>>> place. For instance if they are thought of as a pair in most queries th= en >>>> an alteration might be in order. There can be a large one time cost if >>>> these tables occur in a lot of separate sql calls in the business logic= . >>>=20 >>> Good point. They're in the contacts table and I use them to determine wh= en >>> to make another contact and if prior contacts were more productive in th= e >>> morning or afternoon. >>=20 >> Definitely a datetime (single value) problem, imho >=20 > Actually, to me that seems to be one of the few cases where splitting > them makes sense. I would expect typical updates to be something like > "sane time, but 6 months later" or "same day, but different time". There > might also be constraints like "not before 9am". For queries there might > be stuff like "who do I need to call today", or as Rich already > mentioned, statistics by time of the day. There are probably relatively > few queries where you need to treat date and time as a unit. >=20 > hjp I don=E2=80=99t see any mention of the current data types of the two columns= currently in play. apologies of I missed that.=20 Which of your example updates cannot be done with timestamp? Perhaps the =E2= =80=9Cnot before=E2=80=9Dconstraint but can that be done with OP=E2=80=99s d= esign? Maybe the time column is an interval? >=20 > -- > _ | Peter J. Holzer | Story must make more sense than reality. > |_|_) | | > | | | hjp@hjp.at | -- Charles Stross, "Creative writing > __/ | http://www.hjp.at/ | challenge!" >