Re: Date Index - Mailing list pgsql-sql

From Tom Lane
Subject Re: Date Index
Date
Msg-id 26989.1352128409@sss.pgh.pa.us
Whole thread Raw
In response to Re: Date Index  (Adam Tauno Williams <awilliam@whitemice.org>)
List pgsql-sql
Adam  Tauno Williams <awilliam@whitemice.org> writes:
> OGo=> create index job_date_only on job(extract(date from start_date at
> time zone 'utc'));
> ERROR:  timestamp units "date" not recognized

There's no field called "date" in a timestamp.  I think what you're
trying to achieve is "date_trunc('day', start_date at time zone 'utc')"

http://www.postgresql.org/docs/9.2/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
        regards, tom lane



pgsql-sql by date:

Previous
From: Adam Tauno Williams
Date:
Subject: Re: Date Index
Next
From: pantelis vlachos
Date:
Subject: find sudstring on text (data type) field failure