Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

In response to

Responses

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group