Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Nico Grubert <nicogrubert(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
Date: 2009-03-06 07:01:00
Message-ID: dcc563d10903052301q212690a1v500404afd3c80daf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 5, 2009 at 11:58 PM, Nico Grubert <nicogrubert(at)gmail(dot)com> wrote:
>
>> This query makes little sense.  Why are you trying to convert a
>> timestamp to a timestamp?  Is this a bizarre substitute for date_trunc()?
>
> Got it:
> Thanks for the "date_trunc" tip.
>
> This query works fine:
> date_trunc('day', a.from_datetime) >= date_trunc('day', NOW())

Note that if you need to do this a lot you can make an index on that function.

smarlowe=# create table sometable (ts timestamp);
CREATE TABLE
smarlowe=# create index sometable_ts_day on sometable((date_trunc('day',ts)));

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-03-06 07:02:04 Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
Previous Message Nico Grubert 2009-03-06 06:59:44 Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist