Re: How to setup default value "0000-00-00" for "date" - Mailing list pgsql-general

From Peter Haworth
Subject Re: How to setup default value "0000-00-00" for "date"
Date
Msg-id PGM.20040820172322.459.4809@edison.ioppublishing.com
Whole thread Raw
In response to Re: How to setup default value "0000-00-00" for "date"  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: How to setup default value "0000-00-00" for "date"
List pgsql-general
On Fri, 20 Aug 2004 11:12:40 -0400 (EDT), Bruce Momjian wrote:
> Yes, you use a partial index. The 8.0beta1 docs mention this:
>
>    Indexes are not used for <literal>IS NULL</> clauses by default.
>    The best way to use indexes in such cases is to create a partial
>    index using an <literal>IS NULL</> comparison.

Is this because nulls aren't indexed (I'm sure I remember someone
saying that they are, though), or because (null=null) is null rather
than true? If it's the latter, why couldn't an explicit IS NULL test
be allowed to use the index?

--
    Peter Haworth    pmh@edison.ioppublishing.com
Znqr lbh ybbx

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Postgres filling up hard drive with swap files
Next
From: Tom Lane
Date:
Subject: Re: How to setup default value "0000-00-00" for "date"