inevitability of to_date() when converting representations whichdon't represent whole timestamps

Поиск
Список
Период
Сортировка
От Shaun Cutts
Тема inevitability of to_date() when converting representations whichdon't represent whole timestamps
Дата
Msg-id 5EEA4EE4-7D98-4C9D-9DAB-8D8F563DA5C6@factfiber.com
обсуждение исходный текст
Ответы Re: inevitability of to_date() when convertingrepresentations which don't represent whole timestamps  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: inevitability of to_date() when convertingrepresentations which don't represent whole timestamps  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
When being asked to convert a day of the week, the to_date() function returns the same day ('0001-01-01 BC’) no matter
whichday is converted: 

# select to_date(‘Monday’, ‘Day’)
'0001-01-01 BC’

# select to_date(‘Tuesday’, ‘Day’)
'0001-01-01 BC’

However, if it were to return a date that was that day of the week, it could be inverted:

# select extract(dow from '0001-01-01 BC'::date); — this date should be the result of to_date(‘Sunday’, ‘Day’)
6

# select extract(dow from '0001-01-02 BC'::date); — this date should be the result of to_date(‘Monday’, ‘Day’)
0

….

David tells this is not a bug, but it still seems like a reasonable requirement on to_date() to me. Is there some
reasonwhy this isn’t possible? 



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

Предыдущее
От: harpagornis
Дата:
Сообщение: Tablespace Default Behavior
Следующее
От: harpagornis
Дата:
Сообщение: Re: Tablespace Default Behavior