Re: Default for date field: today vs CURRENT_DATE [RESOLVED]

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

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mihalidesová Jana 2019-01-03 10:59:49 [unixODBC]Unrecognized key passed to SQLGetInfo. {S1C00,NativeErr = 209}
Previous Message Tom Lane 2019-01-02 22:01:14 Re: Default for date field: today vs CURRENT_DATE