Re: Possibly misleading documentation of Template Patterns forDate/Time Formatting

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Possibly misleading documentation of Template Patterns forDate/Time Formatting
Дата
Msg-id CAKFQuwZK1yam_xN8HVQw17UtX4bdYPg8AVX3ECatZ0v2mHvSaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Possibly misleading documentation of Template Patterns for Date/Time Formatting  (David Kubecka <davidkubecka366@gmail.com>)
Список pgsql-bugs
On Friday, April 17, 2020, David Kubecka <davidkubecka366@gmail.com> wrote:
Hi,

on the official docs https://www.postgresql.org/docs/9.6/functions-formatting.html see the table 9-24 and Pattern "Q". The doc (for version 9.6) says:

quarter (ignored by to_date and to_timestamp)

All the later versions of the doc (10, 11, 12) miss the "ignored" note leading the user to think that it should work but it doesn't, at least on 12.1:

# select TO_DATE( '2012-4', 'YYYY-Q' );
  to_date  
------------
 2012-01-01
(1 row)

Is this an expected behaviour, i.e. the documentation is just wrong or it really should work?

It was moved to the usage notes section, and expanded to be more correct.

 to_timestamp and to_date, weekday names or numbers (DAYD, and related field types) are accepted but are ignored for purposes of computing the result. The same is true for quarter (Q) fields.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possibly misleading documentation of Template Patterns for Date/Time Formatting
Следующее
От: Terry Schmitt
Дата:
Сообщение: Re: BUG #16369: Segmentation Faults and Data Corruption withGenerated Columns