Re: Compare an integer to now() - interval '3 days' - Mailing list pgsql-general

From Szymon Guz
Subject Re: Compare an integer to now() - interval '3 days'
Date
Msg-id AANLkTi=fBtJeFTo8Rd2EEE6Tk=57Kz3kCvrdEGWSxgbu@mail.gmail.com
Whole thread Raw
In response to Compare an integer to now() - interval '3 days'  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
On 11 March 2011 14:14, Alexander Farber <alexander.farber@gmail.com> wrote:

# select u.uid, u.name, u.created
from drupal_field_data_field_gender g, drupal_users u
where g.field_gender_value='Robot' and
u.uid=g.entity_id and u.created::timestamp > now() - interval '1 day';
ERROR:  cannot cast type integer to timestamp without time zone
LINE 4: u.uid=g.entity_id and u.created::timestamp > now() - interva...

What should I use instead of ::timestamp please?


Hi,
try this: 

    to_timestamp(u.created) 


regards
Szymon

pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Compare an integer to now() - interval '3 days'
Next
From: Vibhor Kumar
Date:
Subject: Re: Compare an integer to now() - interval '3 days'