Default for date field: today vs CURRENT_DATE

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Default for date field: today vs CURRENT_DATE
Date: 2019-01-02 21:49:21
Message-ID: alpine.LNX.2.20.1901021343520.20959@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Reading the manual I saw that 'today' is a special value, but it did not
work when I used it as a column default; e.g.,
start_date date DEFAULT today,

Appending parentheses also failed. But, changing today to CURRENT_DATE
worked. I've not found an explanation and would appreciate learning why
'today' fails.

TIA,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-01-02 22:01:14 Re: Default for date field: today vs CURRENT_DATE
Previous Message Rich Shepard 2019-01-02 18:28:29 Re: Implementing standard SQL's DOMAIN constraint [RESOLVED]