pgsql: Fix the inadvertent libpq ABI breakage discovered by Martin Pitt:

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix the inadvertent libpq ABI breakage discovered by Martin Pitt:
Дата
Msg-id 20071013201842.2C3F3753E4C@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the
renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2
initdb and psql if they are run with an 8.3beta1 libpq.so.  For the moment
we can rearrange the order of enum pg_enc to keep the same number for
everything except PG_JOHAB, which isn't a problem since there are no direct
references to it in the 8.2 programs anyway.  (This does force initdb
unfortunately.)

Going forward, we want to fix things so that encoding IDs can be changed
without an ABI break, and this commit includes the changes needed to allow
libpq's encoding IDs to be treated as fully independent of the backend's.
The main issue is that libpq clients should not include pg_wchar.h or
otherwise assume they know the specific values of libpq's encoding IDs,
since they might encounter version skew between pg_wchar.h and the libpq.so
they are using.  To fix, have libpq officially export functions needed for
encoding name<=>ID conversion and validity checking; it was doing this
anyway unofficially.

It's still the case that we can't renumber backend encoding IDs until the
next bump in libpq's major version number, since doing so will break the
8.2-era client programs.  However the code is now prepared to avoid this
type of problem in future.

Note that initdb is no longer a libpq client: we just pull in the two
source files we need directly.  The patch also fixes a few places that
were being sloppy about checking for an unrecognized encoding name.

Modified Files:
--------------
    pgsql/src/backend/commands:
        dbcommands.c (r1.200 -> r1.201)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/dbcommands.c?r1=1.200&r2=1.201)
    pgsql/src/backend/utils/adt:
        ascii.c (r1.30 -> r1.31)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ascii.c?r1=1.30&r2=1.31)
        xml.c (r1.47 -> r1.48)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/xml.c?r1=1.47&r2=1.48)
    pgsql/src/backend/utils/mb:
        encnames.c (r1.34 -> r1.35)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/encnames.c?r1=1.34&r2=1.35)
        mbutils.c (r1.66 -> r1.67)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/mbutils.c?r1=1.66&r2=1.67)
    pgsql/src/bin/initdb:
        Makefile (r1.53 -> r1.54)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/initdb/Makefile?r1=1.53&r2=1.54)
        initdb.c (r1.144 -> r1.145)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/initdb/initdb.c?r1=1.144&r2=1.145)
    pgsql/src/bin/pg_dump:
        pg_backup_archiver.c (r1.146 -> r1.147)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.c?r1=1.146&r2=1.147)
        pg_dump.c (r1.472 -> r1.473)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_dump.c?r1=1.472&r2=1.473)
        pg_dumpall.c (r1.92 -> r1.93)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_dumpall.c?r1=1.92&r2=1.93)
    pgsql/src/bin/psql:
        command.c (r1.181 -> r1.182)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/command.c?r1=1.181&r2=1.182)
        common.c (r1.135 -> r1.136)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/common.c?r1=1.135&r2=1.136)
        mbprint.c (r1.25 -> r1.26)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/mbprint.c?r1=1.25&r2=1.26)
        psqlscan.l (r1.21 -> r1.22)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/psqlscan.l?r1=1.21&r2=1.22)
    pgsql/src/bin/scripts:
        createdb.c (r1.23 -> r1.24)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/scripts/createdb.c?r1=1.23&r2=1.24)
    pgsql/src/include/catalog:
        catversion.h (r1.430 -> r1.431)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.430&r2=1.431)
    pgsql/src/include/mb:
        pg_wchar.h (r1.73 -> r1.74)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/mb/pg_wchar.h?r1=1.73&r2=1.74)
    pgsql/src/interfaces/libpq:
        exports.txt (r1.16 -> r1.17)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/exports.txt?r1=1.16&r2=1.17)
        fe-exec.c (r1.192 -> r1.193)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/fe-exec.c?r1=1.192&r2=1.193)
        fe-misc.c (r1.131 -> r1.132)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/fe-misc.c?r1=1.131&r2=1.132)
        libpq-fe.h (r1.138 -> r1.139)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/libpq-fe.h?r1=1.138&r2=1.139)

В списке pgsql-committers по дате отправления:

Предыдущее
От: fxjr@pgfoundry.org (User Fxjr)
Дата:
Сообщение: npgsql - Npgsql2: "Applied patch against CVS containing comments and
Следующее
От: fxjr@pgfoundry.org (User Fxjr)
Дата:
Сообщение: npgsql - Npgsql2: Added initial support for a copy serializer for COPY