Re: [HACKERS] \x output blowing up

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] \x output blowing up
Date: 2005-09-27 16:32:14
Message-ID: 200509271632.j8RGWEf10242@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Sat, Sep 24, 2005 at 07:18:16PM -0400, Bruce Momjian wrote:
> >
> > Well, it seems we are going to have to fix it somehow for 8.1. It is
> > not crashing here so I can't work up a patch. Can you submit a minimal
> > fix for 8.1? Thanks.
>
> Ah, it would only happen if your encoding was UTF-8 since that's the
> only case psql handles differently. I've attached a patch which fixes
> it. With a bit more rearrangement you could probably simplify it a bit
> but this works.

Fixed. You were right that the use of cell_w was incorrect for
non-numeric values (UTF8), and in fact was just too fragile to use.

I redesigned format_numeric_locale() to return an allocated result,
which removed this problem and simplified the code too.

Patch attached and applied.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 7.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-09-27 16:36:19 Re: [HACKERS] BUG #1883: Renaming a schema leaves inconsistent
Previous Message Josh Berkus 2005-09-27 16:26:49 Re: State of support for back PG branches

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-09-27 17:54:44 Re: [HACKERS] \x output blowing up
Previous Message Jonathan Beit-Aharon 2005-09-27 13:35:04 Re: Patching dblink.c to avoid warning about open transaction