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

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

From
Bruce Momjian
Date:
Tom Lane wrote:
> "Peter Haworth" <pmh@edison.ioppublishing.com> writes:
> > ... why couldn't an explicit IS NULL test
> > be allowed to use the index?
>
> It could, if someone cared to puzzle out a way to integrate IS NULL into
> the index opclass and access method API infrastructure.  Right now all
> that stuff assumes that indexable operators are, well, operators (and I
> think there are places that assume they must be binary operators, to
> boot).
>
> I've looked at this once or twice but always decided that the
> bang-for-the-buck ratio was too low compared to other open problems ...

I know we index NULL values in multi-column indexes, but do we
currently even store the rows that have only NULLs in a the index.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I know we index NULL values in multi-column indexes, but do we
> currently even store the rows that have only NULLs in a the index.

btree does.  I don't think any of the other index AMs do.  hash could
probably be made to without much trouble (just decree a hash value,
say zero, for nulls).  But I dunno what rtree or gist would do with a
leading-column null.

            regards, tom lane