Get date timestamp(3) without time zone column - PGSQL 9.5

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Get date timestamp(3) without time zone column - PGSQL 9.5
Date: 2016-09-05 02:57:50
Message-ID: CAJNY3ivqPUgSCL6ERBV_M_auGuEvnS0E_QP7wBcvF1ZbSe5f=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi guys,

I got the tasks table that has the tasks_start column:

> tasks_start | timestamp(3) without time zone

select tasks_start from tasks LIMIT 1;

> tasks_start
> -------------------
> 2016-08-10 00:30:00

I'm trying to cast the date, using this query:

> SELECT cast(tasks_start as date) FROM "jobs" WHERE "tasks"."deleted" = 'f'
> AND "tasks"."recurrence_id" = 1 AND (Date(tasks_start) in ('2016-08-10')

but it doesn't work.. I get 0 rows... what am I doing wrong?

cheers
Patrick

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sameer Kumar 2016-09-05 03:06:07 Re: Get date timestamp(3) without time zone column - PGSQL 9.5
Previous Message Craig Ringer 2016-09-04 23:28:56 Re: BDR: Transactions with global lock