pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: awilliam@whitemice.org
Cc: pgsql-sql@postgresql.org
Subject: Re: Date Index
Date: Mon, 05 Nov 2012 10:13:29 -0500
Message-ID: <26989.1352128409@sss.pgh.pa.us> (raw)
In-Reply-To: <1352112887.4089.1.camel@workstation.wmmi.net>
References: <001e01c93ad0$ffcbe190$ff63a4b0$@hansen@brightbuilders.com>
	<20081031074854.GA1015@a-kretschmer.de>
	<1352112887.4089.1.camel@workstation.wmmi.net>

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




view thread (2+ messages)

Message-ID: <26989.1352128409@sss.pgh.pa.us>
Permalink:  ../26989.1352128409@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26989.1352128409@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, awilliam@whitemice.org
  Subject: Re: Date Index
  In-Reply-To: <26989.1352128409@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox