Gavin Sherry <swm(at)linuxworld(dot)com(dot)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