Re: Date-Time dangling unit fix

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Date-Time dangling unit fix
Дата
Msg-id 807753.1678460966@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Date-Time dangling unit fix  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: Date-Time dangling unit fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Alexander Lakhin <exclusion@gmail.com> writes:
> I also wonder how the units affect time zone parsing.
> With the patch:
> SELECT time with time zone '010203m+3';
> ERROR:  invalid input syntax for type time with time zone: "010203m+3"
> But without the patch:
> SELECT time with time zone '010203m+3';
>   01:02:03+03

Yeah, I think this is the ptype-still-set-at-end-of-loop check.
I'm fine with throwing an error for that.

> Though with "non-unit" spec:
> SELECT time with time zone '010203mmm+3';
>   01:02:03-03
> (With or without the patch.)
> It seems like "units" were just ignored in a time zone specification,
> but now they are rejected.

I think it's reading "mmm+3" as a POSIX timezone spec.  From memory,
POSIX allows any sequence of 3 or more letters as a zone abbreviation.
It looks like we're being lax and not enforcing the "3 or more" part:

regression=# set time zone 'foobar+3';
SET
regression=# select timeofday();
               timeofday                
----------------------------------------
 Fri Mar 10 12:08:24.484853 2023 FOOBAR
(1 row)

regression=# set time zone 'fo+3';
SET
regression=# select timeofday();
             timeofday              
------------------------------------
 Fri Mar 10 12:08:38.207311 2023 FO
(1 row)

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: Use ICU by default at initdb time.
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum