Re: index compatible date_trunc in postgres? - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: index compatible date_trunc in postgres?
Date
Msg-id 20081219130628.GD4278@alvh.no-ip.org
Whole thread Raw
In response to Re: index compatible date_trunc in postgres?  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-sql
Scott Marlowe escribió:
> On Thu, Dec 18, 2008 at 10:46 PM, Bryce Nesbitt <bryce2@obviously.com> wrote:
> > I've got a legacy app that does 8.3 incompatible date searches like so:
> > explain select count(*) from contexts where publication_date like '2006%';
> > explain select count(*) from contexts where publication_date like
> > '2006-09%';

> You can create an index on date_trunc (on timestamp without timezone,
> but not on timestamp with timezone since it's not immutable)

But you can create an index on the timestamptz AT TIME ZONE 'GMT', I
think.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-sql by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: index compatible date_trunc in postgres?
Next
From: Tom Lane
Date:
Subject: Re: index compatible date_trunc in postgres?