Extract date from a TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL column

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Extract date from a TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL column
Date: 2016-09-22 03:37:18
Message-ID: CAJNY3itr9HrO+2ansEvhgWsozYq=My3HGnOMAQ+AVf82yC-1WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi guys,

I'm using postgres 9.2 and got the following column:

start TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL

SELECT start FROM test1;

2015-12-18 02:40:00

I need to split that date into two columns on my select:

2015-12-18 = date column
02:40:00 = time column

How can I do that without modifying any column/data?
Maybe in a select?

Thanks!
Patrick

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Barwick 2016-09-22 03:50:58 Re: Extract date from a TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL column
Previous Message Jeff Janes 2016-09-22 02:43:50 Re: Re: performance problems with bulk inserts/updates on tsrange with gist-based exclude constrains