Re: libpq5 8.3 breaks 8.2 compatibility with encodings

From: Martin Pitt <martin(at)piware(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: libpq5 8.3 breaks 8.2 compatibility with encodings
Date: 2007-10-12 15:14:46
Message-ID: 20071012151446.GI5911@piware.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
13-libpq8.2-compat.patch text/x-diff 2.0 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-10-12 15:50:35 Re: libpq5 8.3 breaks 8.2 compatibility with encodings
Previous Message ITAGAKI Takahiro 2007-10-12 14:56:16 BUG #3674: Unnecessary checkpoints by WAL Writer