Re: Comparing dates in DDL

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Comparing dates in DDL
Date: 2019-01-04 17:53:43
Message-ID: 55d28758-0b55-5d91-83fc-7b601eaa3d02@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 1/4/19 10:26 AM, Rich Shepard wrote:
> On Fri, 4 Jan 2019, Rob Sargent wrote:
>
>> Is the end_date always knowable at record insert?
>
> Rob,
>
>   Not always. Sometimes projects have known end dates, other times the
> end
> is interminate until it happens.
>
>> CHECK(end_date is null or start_date <= end_date)
>
>   So a default of NULL should be applied, or just allowed to happen?
>
> Thanks,
>
> Rich
>
This is exactly what null is for.  Much preferable to some arbitrary
value which will confuse analyses.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-01-04 17:59:59 Re: Comparing dates in DDL
Previous Message David G. Johnston 2019-01-04 17:48:17 Re: Comparing dates in DDL