to_timestamp() and quarters
Asher Hoskins <asher@piceur.co.uk>
From: Asher Hoskins <asher@piceur.co.uk>
To: pgsql-general@postgresql.org
Date: 2010-03-02T10:47:03Z
Lists: pgsql-hackers, pgsql-general
Hello.
I can't seem to get to_timestamp() or to_date() to work with quarters,
can anyone see what I'm doing wrong?
e.g.
select to_date('2010-1', 'YYYY-Q');
Gives "2010-01-01" (correct).
select to_date('2010-3', 'YYYY-Q');
Also gives "2010-01-01" (should be 2010-07-01);
Am I misunderstanding how this function works? EXTRACT(QUARTER FROM
date) works fine.
I'm running Postgresql 8.4.2 on a FreeBSD system.
Thanks,
Asher.