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

From Tom Lane
Subject Re: libpq5 8.3 breaks 8.2 compatibility with encodings
Date
Msg-id 29815.1192209792@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq5 8.3 breaks 8.2 compatibility with encodings  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: libpq5 8.3 breaks 8.2 compatibility with encodings
List pgsql-bugs
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> But OTOH, I feel we should just stop exporting them now; I don't think
> there's a legitimate use case for a client application to use them.

Actually, that doesn't seem workable as a solution to our immediate
problem: we surely can't remove exported symbols without doing a soname
bump.

Also, in general it seems like a bad idea to try to freeze the values of
the enum: what happens when we want to add some more server-side
encodings?  We will never be able to do that without moving the
client-only ones.

I think what we must do here is decouple libpq's values of the enum from
the backend's.  As long as a client talking to libpq does not have any
preconceived notions about what the numbers mean, it's fine.  (And in
that mindset, we *do* need to export pg_encoding_to_char and so on,
so that clients can use those functions to map to encoding names instead
of making it up themselves.)

I'm becoming more and more convinced that this is initdb's bug not
libpq's.  The problem stems from initdb using libpq's functions and
assuming that its numbers match up with pg_wchar.h.  But note that
pg_wchar.h is not exported by libpq.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: libpq5 8.3 breaks 8.2 compatibility with encodings
Next
From: Martin Pitt
Date:
Subject: Re: libpq5 8.3 breaks 8.2 compatibility with encodings