Re: Using SELECT WHERE - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Using SELECT WHERE
Date
Msg-id 20040420180455.GC11203@wolff.to
Whole thread Raw
In response to Using SELECT WHERE  (Michal Lijowski <michal@cvu.wustl.edu>)
List pgsql-novice
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.

pgsql-novice by date:

Previous
From: Ron St-Pierre
Date:
Subject: Re: Start with -i
Next
From: Nabil Sayegh
Date:
Subject: Re: Using SELECT WHERE