Re: libpq5 8.3 breaks 8.2 compatibility with encodings - Mailing list pgsql-bugs

From Martin Pitt
Subject Re: libpq5 8.3 breaks 8.2 compatibility with encodings
Date
Msg-id 20071012151446.GI5911@piware.de
Whole thread Raw
In response to libpq5 8.3 breaks 8.2 compatibility with encodings  (Martin Pitt <martin@piware.de>)
Responses Re: libpq5 8.3 breaks 8.2 compatibility with encodings
List pgsql-bugs
Hi,

Martin Pitt [2007-10-12 16:33 +0200]:
> I'm currently hunting down the last postgresql-common test case
> failure that I see with 8.3beta1. It seems the 8.3 version of libpq
> changes some internal encoding lists?

Ah, got it. The ordering in pg_enc2name_tbl[] changed, which makes the
indices jump around. This was introduced in [1], in particular in
those two bits:

  http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/mb/pg_wchar.h.diff?r1=1.71;r2=1.72
  http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/encnames.c.diff?r1=1.32;r2=1.33

With attached patch (which restores the previous ordering)
compatibility with 8.2 is restored. This has two drawbacks:

 * The enum cannot be nicely sorted by internal and client-only
   encodings until libpq bumps soname again. This is only a cosmetical
   problem, though.

 * This patch needs another catalog bump (to "unbump" the
   one in [1]). That's unfortunate, but the catalog number got bumped
   in between beta and release in earlier versions, too, so I hope
   it's not too bad.

The pg_enc2name_tbl declaration should probably have a comment saying
to never alter the order, but only append new stuff at the end. For
encodings which became obsolete (should that happen) there should be
an constant like "INVALID" or "DEPRECATED".

Thank you!

Martin

[1] http://archives.postgresql.org/pgsql-committers/2007-04/msg00198.php


--
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachment

pgsql-bugs by date:

Previous
From: "ITAGAKI Takahiro"
Date:
Subject: BUG #3674: Unnecessary checkpoints by WAL Writer
Next
From: Tom Lane
Date:
Subject: Re: libpq5 8.3 breaks 8.2 compatibility with encodings