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

From: Harald Fuchs <hf0722x(at)protecting(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to setup default value "0000-00-00" for "date"
Date: 2004-08-22 12:15:19
Message-ID: puy8k7cqso.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <twig(dot)1093012692(dot)59157(at)kelcomaine(dot)com>,
"Jim Wilson" <jimw(at)kelcomaine(dot)com> writes:

> It'd probably be better design to not use the date as a flag. This issue
> actually came up for me yesterday with an application that is now being ported
> to Postgres. Previously a null "ship date" indicated that an item to be
> shipped had not gone yet. I'm adding a flag, not just because of this issue
> you describe, but it is also more intuitive for anyone looking at the data
> who is unfamiliar with the business logic.

Me thinks that's somewhat unclean. Is your shipDate nullable? If
yes, what's the meaning of "shipDate IS NULL"? If no, what do you put
in that field if notYetShipped is true?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2004-08-22 13:01:46 Re: Unsupported 3rd-party solutions (Was: Few questions on postgresql (dblink, 2pc, clustering))
Previous Message Jim Worke 2004-08-22 10:43:32 Re: Unsupported 3rd-party solutions (Was: Few questions on postgresql (dblink, 2pc, clustering))