Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-hackers

I can't seem to get to_timestamp() or to_date() to work with quarters, 
can anyone see what I'm doing wrong?

	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.



pgsql-hackers by date

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

pgsql-general by date

Next:From: Antonio Gom├ęz SotoDate: 2010-03-02 11:12:23
Subject: How to grant a user read-only access to a database?
Previous:From: Greg StarkDate: 2010-03-02 09:49:31
Subject: Re: Hung postmaster (8.3.9)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group