Re: [PATCH] psql formatting patch (round 2)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] psql formatting patch (round 2)
Date: 2006-02-10 00:36:52
Message-ID: 200602100036.k1A0aqG18383@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Modified patch attached and applied. I made some style changes and had
some merge conflicts because wchar.c has changed since 8.1.

The change to libpq's PQdsplen() seems like a good one and I will
mention it in the release notes.

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> [Please CC any replies, thanks]
>
> This patch has the same effect as the last one except it now uses the
> PQmblen and PQdsplen functions exported by libpq as suggested by Tom.
> This clears a lot of stuff from psql's mbprint.c which is a good thing.
> This means it should work for all for encodings (though I can't say I
> tested them all).
>
> The PQdsplen function in libpq has been improved so it can actually
> work and provide the necessary information for formatting. That file
> (wchar.c) is actually shared with the backend but the backend doesn't
> use the dsplen functions, so it does add some dead code (on top of what
> was already there).
>
> Note: this changes the PQdsplen function, it can now return zero or
> minus one which was not possible before. It doesn't appear anyone is
> actually using the functions other than psql but it is a change. The
> functions are not actually documentated anywhere so it's not like we're
> breaking a defined interface. The new semantics follow the Unicode
> standard.
>
> The other uses of PQdsplen in psql (in ReportSyntaxErrorPosition) would
> seem to be slightly affected by the change, except it's not clear how
> psql should react to control characters in the string it's trying to
> print...
>
> Patch available at:
> http://svana.org/kleptog/pgsql/psql-format.patch
>
> Comments welcome,
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> > tool for doing 5% of the work and then sitting around waiting for someone
> > else to do the other 95% so you can sue them.

[ Attachment, skipping... ]
-- End of PGP section, PGP failed!

--
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 44.2 KB

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-02-10 00:38:53 Re: [PATCH] psql formatting patch (round 2)
Previous Message Tom Lane 2006-02-09 22:42:17 Re: contrib/xinetops for 8.1 "patch"