From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@postgresql.org
Subject: Re: Default for date field: today vs CURRENT_DATE [RESOLVED]
Date: Wed, 2 Jan 2019 14:12:42 -0800 (PST)
Message-ID: <alpine.LNX.2.20.1901021410140.20959@salmo.appl-ecosys.com> (raw)
In-Reply-To: <10029.1546466474@sss.pgh.pa.us>
References: <alpine.LNX.2.20.1901021343520.20959@salmo.appl-ecosys.com>
<10029.1546466474@sss.pgh.pa.us>
On Wed, 2 Jan 2019, Tom Lane wrote:
> 'today' is special as a date input string, so you can use it as a literal:
>
> regression=# select 'today'::date;
> date
> ------------
> 2019-01-02
> (1 row)
>
> But it's not a SQL keyword, nor a function name, so you can't write it
> without quotes.
Tom,
Now I understand. I tried it with quotes, too, but this was in the table
definition, not as a selection criterion. I did not pick up this difference
when reading about the date-time data types.
Thanks very much for clarifying.
Best regards,
Rich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rshepard@appl-ecosys.com
Subject: Re: Default for date field: today vs CURRENT_DATE [RESOLVED]
In-Reply-To: <alpine.LNX.2.20.1901021410140.20959@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.1901021343520.20959@salmo.appl-ecosys.com> <10029.1546466474@sss.pgh.pa.us> <alpine.LNX.2.20.1901021410140.20959@salmo.appl-ecosys.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox