inevitability of to_date() when converting representations whichdon't represent whole timestamps - Mailing list pgsql-general

From Shaun Cutts
Subject inevitability of to_date() when converting representations whichdon't represent whole timestamps
Date
Msg-id 5EEA4EE4-7D98-4C9D-9DAB-8D8F563DA5C6@factfiber.com
Whole thread Raw
Responses Re: inevitability of to_date() when convertingrepresentations which don't represent whole timestamps
Re: inevitability of to_date() when convertingrepresentations which don't represent whole timestamps
List 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 by date:

Previous
From: harpagornis
Date:
Subject: Tablespace Default Behavior
Next
From: harpagornis
Date:
Subject: Re: Tablespace Default Behavior