1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

Accept "+infinity" in date and timestamp[tz] input.

The float and numeric types accept this variant spelling of
"infinity", so it seems like the datetime types should too.

Vik Fearing, some cosmetic mods by me

Discussion: https://postgr.es/m/d0bef637-2dbd-0a5d-e539-48243b6f6c5e@postgresfriends.org
This commit is contained in:
Tom Lane
2023-01-01 14:16:07 -05:00
parent d747dc85ae
commit 2ceea5adb0
7 changed files with 25 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ const char *const days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
*/
static const datetkn datetktbl[] = {
/* token, type, value */
{"+infinity", RESERV, DTK_LATE}, /* same as "infinity" */
{EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */
{DA_D, ADBC, AD}, /* "ad" for years > 0 */
{"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */