Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVOMn-0001si-ME for pgsql-sql@postgresql.org; Mon, 05 Nov 2012 15:13:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVOMl-0006YV-Cn for pgsql-sql@postgresql.org; Mon, 05 Nov 2012 15:13:33 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qA5FDTee026990; Mon, 5 Nov 2012 10:13:29 -0500 (EST) From: Tom Lane To: awilliam@whitemice.org cc: pgsql-sql@postgresql.org Subject: Re: Date Index 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> Comments: In-reply-to Adam Tauno Williams message dated "Mon, 05 Nov 2012 05:54:47 -0500" Date: Mon, 05 Nov 2012 10:13:29 -0500 Message-ID: <26989.1352128409@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/2 X-Sequence-Number: 36935 Adam Tauno Williams 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