Re: Bug in date.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Bug in date.c
Date: 2007-06-02 15:55:10
Message-ID: 16227.1180799710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> There's a bug in datetime.c when it handles errors converting text into
> various date formats. It tries to avoid palloc'ing a cstring copy of the in=
> put
> by storing it in a stack variable instead but that means it can't handle
> inputs over MAXDATELEN. So it throws an error but passes the varlena string
> where the format expects a c string. Of course having to generate a c string
> for the format begs the question...

Good catch. I'm hoping that all three of these functions will go away
before 8.3 is out (in favor of a generic text cast capability), but we
need a back-patchable fix for the released branches. So the "minimal"
patch looks the best to me --- least risk of patch trouble.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Luke Lonergan 2007-06-02 17:47:58 Re: Seq scans status update
Previous Message Andrew Dunstan 2007-06-02 13:19:06 Re: [PATCHES] build/install xml2 when configured with libxml