Re: [SQL] default for date/time types - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: [SQL] default for date/time types
Date
Msg-id Pine.GSO.4.02A.10003060806200.17581-100000@Svan.DoCS.UU.SE
Whole thread Raw
In response to default for date/time types  ("Seth Banks" <seth@subimage.com>)
List pgsql-sql
On Sun, 5 Mar 2000, Seth Banks wrote:

> if i were to setup a date or time type in my database, what would be a
> good default value to use (an empty one, but not null)

The way you're asking you probably do want to use NULL because there's no
such thing as an "empty date". NULL is supposed to fill exactly that gap.
However, if for some reason you really can't use NULL then consider
perhaps 'invalid' or '-infinity' but these are distinctly non-portable and
might not buy you much in terms of elegance. Implementor beware. :)

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-sql by date:

Previous
From: "Seth Banks"
Date:
Subject: default for date/time types
Next
From: Peter Eisentraut
Date:
Subject: Re: [SQL] dayname() doubt