Re: [SQL] default for date/time types

From: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
To: Seth Banks <seth(at)subimage(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] default for date/time types
Date: 2000-03-06 07:09:31
Message-ID: Pine.GSO.4.02A.10003060806200.17581-100000@Svan.DoCS.UU.SE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2000-03-06 07:12:52 Re: [SQL] dayname() doubt
Previous Message Seth Banks 2000-03-06 06:28:18 default for date/time types