Re: to_date_valid()

Поиск
Список
Период
Сортировка
От Andreas 'ads' Scherbaum
Тема Re: to_date_valid()
Дата
Msg-id 577B7ADE.5070504@wars-nicht.de
обсуждение исходный текст
Ответ на Re: to_date_valid()  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On 05.07.2016 06:05, Pavel Stehule wrote:
>
>
> 2016-07-05 2:39 GMT+02:00 Andreas 'ads' Scherbaum <adsmail@wars-nicht.de
> <mailto:adsmail@wars-nicht.de>>:
>
>     On 04.07.2016 18:37, Pavel Stehule wrote:
>
>
>         I don't know if the name "strict" is best, but the name
>         "validate" is
>         not good too. Current to_date does some validations too.
>
>
>     Obviously not enough, because it allows invalid dates. I'd say that
>     the current to_date() merely validates the input format for string
>     parsing, and that the date is in range. But there is not much
>     validation on the date itself.
>
>     So the name can't be "strict" because of the conflict with "NULL"
>     handling, and you don't like "valid" - what other options do you offer?
>
>
> I have not - so third option looks best for me - it can be long name
> "only_correct_date", "only_valid_date", "only_valid_date_on_input" ...

Then you don't have "to_date" in the function name, but still use 
"valid" in the name. How is that useful to remember the function? Where 
"to_date_valid" already gives you the idea that it is "to_date" with an 
additional "valid"ator.

Don't make it overly complicated.

--             Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project



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

Предыдущее
От: Victor Wagner
Дата:
Сообщение: Re: OpenSSL 1.1 breaks configure and more
Следующее
От: Andreas 'ads' Scherbaum
Дата:
Сообщение: Re: to_date_valid()