On Thu, Apr 15, 2004 at 14:03:03 -0500,
Michal Lijowski <michal@cvu.wustl.edu> wrote:
> I made a database and I would like to select entries
> which have data not equal to the specified date.
> I have postgresql-7.3.4-11 on Red Hat Fedora Core 1.
>
> Here is the command
>
> RabStudies=> SELECT RabNo, ImplantDate, Comments FROM RabStudiesInfo
> where implantdate <> 0001-01-01;
I believe that you just want to quote the constant. 0001-01-01 is being
treated as 0 and that is somehow being compared to the date. I am not
sure exactly what is going on as integers don't seem to promote to
date or time. EXPLAIN VERBOSE shpws what's happening but I don't know
the oids of operators by heart so it isn't immediately obvious to me
what is happening, but you can use that to check it out yourself if
you want.