Re: Timestamp trouble

From: "Daniel T(dot) Staal" <DStaal(at)usa(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Timestamp trouble
Date: 2005-06-08 16:59:48
Message-ID: 54989.63.172.115.138.1118249989.squirrel@MageHandbook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Razvan Costea-Barlutiu said:
> Hello all,
>
> I am getting hit by errors in timestamp formatting on seemingly valid
> timestamps:
> 19990108040506.
>
> From the PG manual:
>
> <Valid input for the time stamp types consists of a concatenation of a
> date and a time, followed by an optional time zone, followed by an
> optional AD or BC. (Alternatively, AD/BC can appear before the time zone,
> but this is not the preferred ordering.)>
>
> The string above is the concatenation of two ISO 8601 date+time fields but
> still, the error is thrown each time.
>
> Is this a bug or is it a workaround for this?

Here is the actual parse order for date and time fields:
http://www.postgresql.org/docs/8.0/interactive/datetime-appendix.html

From that, I wouldn't see how it would figure out to parse a 12 digit
field. I'd suggest breaking it down a little: putting a space in between
the date and time would probably be enough of a hint.

Daniel T. Staal

------------------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you are
expressly allowed to retransmit, quote, or otherwise use the contents
for non-commercial purposes. This copyright will expire 5 years after
the author's death, or in 30 years, whichever is longer, unless such a
period is in excess of local copyright law.
------------------------------------------------------------------------

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Razvan Costea-Barlutiu 2005-06-08 17:02:21 Re: Timestamp trouble
Previous Message Bruno Wolff III 2005-06-08 16:54:31 Re: Timestamp trouble