Re: Date-time extraneous fields with reserved keywords - Mailing list pgsql-hackers

From Keisuke Kuroda
Subject Re: Date-time extraneous fields with reserved keywords
Date
Msg-id 167781848301.628976.9656818333290979930.pgcf@coridan.postgresql.org
Whole thread Raw
In response to Date-time extraneous fields with reserved keywords  (Joseph Koshakow <koshy44@gmail.com>)
Responses Re: Date-time extraneous fields with reserved keywords  (Joseph Koshakow <koshy44@gmail.com>)
List pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           tested, passed
Documentation:            tested, passed

Hi Joseph,

Good catch.
Of the reserved words that are special values of type Date/Time, 
'now', 'today', 'tomorrow', 'yesterday', and 'allballs', 
I get an error even before applying the patch.

One thing I noticed is that the following SQL 
returns normal results even after applying the patch.

postgres=# select timestamp 'epoch 01:01:01';
      timestamp
---------------------
 1970-01-01 00:00:00
(1 row)

When 'epoch','infinity','-infinity' and time are specified together, 
the time specified in the SQL is not included in result.
I think it might be better to assume that this pattern is also an error.
What do you think?

As a side note,
reserved words such as 'today', 'tomorrow', and 'yesterday'
can be used to specify a time.

postgres=# select timestamp 'today 01:01:01';
      timestamp
---------------------
 2023-03-03 01:01:01
(1 row)

Best Regards,
Keisuke Kuroda
NTT Comware

The new status of this patch is: Waiting on Author

pgsql-hackers by date:

Previous
From: Daneel Yaitskov
Date:
Subject: min/max aggregation for jsonb
Next
From: Isaac Morland
Date:
Subject: Re: Remove source code display from \df+?