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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-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

Browse pgsql-general by date

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

Browse pgsql-hackers by date

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