Re: Date Index - Mailing list pgsql-sql

From Tom Lane
Subject Re: Date Index
Date
Msg-id 4050.1225756757@sss.pgh.pa.us
Whole thread Raw
In response to Re: Date Index  ("Ryan Hansen" <ryan.hansen@brightbuilders.com>)
List pgsql-sql
"Ryan Hansen" <ryan.hansen@brightbuilders.com> writes:
> Incidentally,  extract(date from ts) doesn't work on my install of 8.3

The field names recognized by extract() are quite well documented
http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
and "date" isn't one of them.

What you probably want is just to cast the timestamp to date:cast(ts as date)    -- SQL standard syntaxts::date
--traditional Postgres abbreviation
 
        regards, tom lane


pgsql-sql by date:

Previous
From: "Ryan Hansen"
Date:
Subject: Re: Date Index
Next
From: "Bart van Houdt"
Date:
Subject: Display message to user