Re: Convert date and time colums to datetime

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Convert date and time colums to datetime
Date: 2025-10-19 16:35:39
Message-ID: b15aa3a-f878-cb2-1749-b418de4fabe@appl-ecosys.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

> 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.

Thanks,

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Isaac Morland 2025-10-19 16:46:11 Re: Convert date and time colums to datetime
Previous Message Adrian Klaver 2025-10-19 14:56:57 Re: Convert date and time colums to datetime