Re: Incorrect "invalid AM/PM string" error from to_timestamp

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua Tolley" <eggyknap(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, "Brendan Jurd" <direvus(at)gmail(dot)com>
Subject: Re: Incorrect "invalid AM/PM string" error from to_timestamp
Date: 2008-09-25 22:07:23
Message-ID: 34d269d40809251507y4eec6ad7s641c20d9b62ed5a4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Sep 25, 2008 at 4:05 PM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
> On Thu, Sep 25, 2008 at 10:22 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> A likely bet is that this is caused by use of uninitialized memory,
>> which happens to have garbage rather than zeroes in it the second
>> time through.
>
> Yep both DCH_MC and DCH_US were going past the end of the string
> because they still added the length of the string where
> from_char_parse_int_len takes care of that for us now...
>
> The attach patch fixes it and tries to improve the "invalid AM/PM
> string" a bit by showing the string.

[Actually attaches the patch...]

Attachment Content-Type Size
fix_to_timestamp.patch application/octet-stream 1.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message austijc 2008-09-26 00:09:43 ERROR: unexpected data beyond EOF in block XXXXX of relation "file"
Previous Message Alex Hunsaker 2008-09-25 22:05:04 Re: Incorrect "invalid AM/PM string" error from to_timestamp