mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Remove explicit error handling for obsolete date/time values
The date/time values 'current', 'invalid', and 'undefined' were removed a long time ago, but the code still contains explicit error handling for the transition. To simplify the code and avoid having to handle these values everywhere, just remove the recognition of these tokens altogether now. Reviewed-by: Michael Paquier <michael@paquier.xyz>
This commit is contained in:
@ -143,8 +143,6 @@ typedef int32 fsec_t;
|
||||
#define DTK_AGO 5
|
||||
|
||||
#define DTK_SPECIAL 6
|
||||
#define DTK_INVALID 7
|
||||
#define DTK_CURRENT 8
|
||||
#define DTK_EARLY 9
|
||||
#define DTK_LATE 10
|
||||
#define DTK_EPOCH 11
|
||||
|
@ -111,7 +111,6 @@ static const datetkn datetktbl[] = {
|
||||
#endif
|
||||
{"cot", TZ, -18000}, /* Columbia Time */
|
||||
{"cst", TZ, -21600}, /* Central Standard Time */
|
||||
{DCURRENT, RESERV, DTK_CURRENT}, /* "current" is always now */
|
||||
#if 0
|
||||
cvst
|
||||
#endif
|
||||
@ -201,7 +200,6 @@ static const datetkn datetktbl[] = {
|
||||
idt /* Israeli, Iran, Indian Daylight Time */
|
||||
#endif
|
||||
{LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */
|
||||
{INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
|
||||
{"iot", TZ, 18000}, /* Indian Chagos Time */
|
||||
{"irkst", DTZ, 32400}, /* Irkutsk Summer Time */
|
||||
{"irkt", TZ, 28800}, /* Irkutsk Time */
|
||||
@ -372,7 +370,6 @@ static const datetkn datetktbl[] = {
|
||||
#endif
|
||||
{"ulast", DTZ, 32400}, /* Ulan Bator Summer Time */
|
||||
{"ulat", TZ, 28800}, /* Ulan Bator Time */
|
||||
{"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
|
||||
{"ut", TZ, 0},
|
||||
{"utc", TZ, 0},
|
||||
{"uyst", DTZ, -7200}, /* Uruguay Summer Time */
|
||||
@ -440,7 +437,6 @@ static const datetkn deltatktbl[] = {
|
||||
{"hours", UNITS, DTK_HOUR}, /* "hours" relative */
|
||||
{"hr", UNITS, DTK_HOUR}, /* "hour" relative */
|
||||
{"hrs", UNITS, DTK_HOUR}, /* "hours" relative */
|
||||
{INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */
|
||||
{"m", UNITS, DTK_MINUTE}, /* "minute" relative */
|
||||
{"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
|
||||
{"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
|
||||
@ -471,7 +467,6 @@ static const datetkn deltatktbl[] = {
|
||||
{DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */
|
||||
{"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */
|
||||
{"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */
|
||||
{"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
|
||||
{"us", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
|
||||
{"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
|
||||
{DMICROSEC, UNITS, DTK_MICROSEC}, /* "microsecond" relative */
|
||||
|
@ -253,10 +253,6 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
|
||||
TIMESTAMP_NOBEGIN(result);
|
||||
break;
|
||||
|
||||
case DTK_INVALID:
|
||||
errno = PGTYPES_TS_BAD_TIMESTAMP;
|
||||
return noresult;
|
||||
|
||||
default:
|
||||
errno = PGTYPES_TS_BAD_TIMESTAMP;
|
||||
return noresult;
|
||||
|
Reference in New Issue
Block a user