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 06:57:24
Message-ID: dcc563d10903052257n517f1c8dpad1d6afad7898e1e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 5, 2009 at 11:53 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()?
>
> The "from_datetime" column is of type "timestamp" but I want to check only
> the date, not the time.
> In this example I want to retrieve all records whose "from_datetime" is e.g.
>>= 2009/05/06 (Now()) so I'd like to get results with a "from_datetime" like
> e.g.
> - 2009/05/06 00:05:00
> - 2009/05/06 23:30:00
> - 2009/05/07 10:15:00

Then just cast it to date...

select * from table where timestampfield::date >= '2009-01-01'::date;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nico Grubert 2009-03-06 06:58:16 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:53:25 Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist