Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 5, 2009 at 11:58 PM, Nico Grubert <nicogrubert@xxxxxxxxx> 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)));

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux