Re: Comparing dates in DDL

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Comparing dates in DDL
Date: 2019-01-04 17:12:23
Message-ID: CA+FnnTwVws6QCUAn4P6tHVkNCpddq9M7OOLN3B+27ZL80TCihg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, Rich,

On Fri, Jan 4, 2019 at 10:53 AM Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
>
> I have a projects table that includes these two columns:
>
> start_date date DEFAULT CURRENT_DATE,
> end_date date
> CONSTRAINT valid_start_date
> CHECK (start_date <= end_date),
>
> 1. Do I need a DEFAULT value for the end_date?
> 2. If so, please suggest a value for it.

start_date.day() + 1?

Thank you.

>
> TIA,
>
> Rich
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2019-01-04 17:16:45 Re: Comparing dates in DDL
Previous Message Pavel Stehule 2019-01-04 17:00:08 Re: Showing table comments with psql