Re: [HACKERS] Date conversion using day of week

Brendan Jurd <direvus@gmail.com>

From: Brendan Jurd <direvus@gmail.com>
To: marc@bloodnok.com
Cc: Adrian Klaver <adrian.klaver@gmail.com>, pgsql-hackers@postgresql.org, Steve Crawford <scrawford@pinpointresearch.com>, pgsql-general@postgresql.org, hackers@postgresql.org
Date: 2011-03-31T16:07:07Z
Lists: pgsql-hackers
On 1 April 2011 02:35, Marc Munro <marc@bloodnok.com> wrote:
> Just to be clear, the reason I was mixing things in this way was that I
> wanted to validate that the dayname being passed was valid for the
> current locale, and I could find no easier way of doing it.

Ah, I see.  In that case I think to_date would have disappointed you
even if IYYY-IW-DY did work, since the inputs do not appear to be
checked against the localised versions of the day names.  They are
only checked against the hard-coded English names.  to_date and
to_char are asymmetric in this sense -- localisation only happens on
the way out.

Cheers,
BJ