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

From Vibhor Kumar
Subject Re: Compare an integer to now() - interval '3 days'
Date
Msg-id 7774C058-7E17-4486-812C-915EDDA1EB8A@enterprisedb.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 Mar 11, 2011, at 6:44 PM, Alexander Farber wrote:

> 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


Use to_timestamp function. For more detail refer following documentation:
http://www.postgresql.org/docs/8.3/static/functions-formatting.html

Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
vibhor.kumar@enterprisedb.com
Blog:http://vibhork.blogspot.com


pgsql-general by date:

Previous
From: Szymon Guz
Date:
Subject: Re: Compare an integer to now() - interval '3 days'
Next
From: "Igor Neyman"
Date:
Subject: Re: sort mem: size in RAM vs size on Disk