Re: How to setup default value "0000-00-00" for "date"

From: "Peter Haworth" <pmh(at)edison(dot)ioppublishing(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to setup default value "0000-00-00" for "date"
Date: 2004-08-20 17:23:22
Message-ID: PGM.20040820172322.459.4809@edison.ioppublishing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)edison(dot)ioppublishing(dot)com
Znqr lbh ybbx

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-08-20 17:51:55 Re: How to setup default value "0000-00-00" for "date"
Previous Message Bill Moran 2004-08-20 17:02:18 Re: Postgres filling up hard drive with swap files