Re: date index problems - Mailing list pgsql-hackers

From Tom Lane
Subject Re: date index problems
Date
Msg-id 10218.1048225589@sss.pgh.pa.us
Whole thread Raw
In response to Re: date index problems  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:
> I presume the type of plan_next is 'date'. Does casting '2003-01-01'::date
> - interval '1 week' to date help?

Easier would be'2003-01-01'::date - 7
which yields a date to start with.  But yeah, date minus interval yields
a timestamp, which will not automatically downconvert to a date, thus
you don't get to use an index on date.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: probs with postgres
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: probs with postgres