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

Re: [GENERAL] to_timestamp() and quarters

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] to_timestamp() and quarters
Date: 2010-03-03 05:55:43
Message-ID: 20100303055543.GA19135@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
In response to Bruce Momjian :
> Well, I can easily make it do what you expect, and I don't see many
> error returns in that area of the code, so I just wrote a patch that
> does what you would expect rather than throw an error.

Well, that's great and better than an error, thx.

> 	test=> select to_date('2010-7', 'YYYY-Q');
> 	  to_date
> 	------------
> 	 2011-07-04
> 	(1 row)

Is this per SQL-Spec? I would expect an error for a quarter not in
(1,2,3,4).

But stop, now i see:

test=*# select to_date('2010-02-29', 'YYYY-MM-DD');
  to_date
------------
 2010-03-01
(1 row)

So it is maybe a congruously behavior ;-)


Regards, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-03-03 06:00:26
Subject: Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of
Previous:From: Robert HaasDate: 2010-03-03 05:26:29
Subject: Re: renameatt() can rename attribute of index, sequence, ...

pgsql-general by date

Next:From: Albe LaurenzDate: 2010-03-03 08:11:00
Subject: Re: [GENERAL] to_timestamp() and quarters
Previous:From: Greg FischerDate: 2010-03-03 04:28:02
Subject: Re: Trigger help - updates to column data with null values

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