to_timestamp() and quarters

From: Asher Hoskins <asher(at)piceur(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: to_timestamp() and quarters
Date: 2010-03-02 10:47:03
Message-ID: 4B8CECA7.2060301@piceur.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Antonio Goméz Soto 2010-03-02 11:12:23 How to grant a user read-only access to a database?
Previous Message Greg Stark 2010-03-02 09:49:31 Re: Hung postmaster (8.3.9)

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-03-02 11:28:51 Re: How far are projections pushed down the execution tree?
Previous Message tmp 2010-03-02 10:31:58 How far are projections pushed down the execution tree?