Hi PostgreSQL developers,
I recently got this bug report about a missing declaration of
pg_encoding_to_char() in the official client library headers
(PostgreSQL 8.1.4). This causes some build problems of depending
packages like the ruby bindings [1].
So, should this function be declared in libpq-fe.h (or pg_wchar.h
included into the postgresql client development package), or is this
function obsolete?
Thank you!
Martin
[1] http://bugs.debian.org/18858
----- Forwarded message from Matej Vela <vela(at)debian(dot)org> -----
Subject: Bug#380047: libpq-dev: no declaration for pg_encoding_to_char
Reply-To: Matej Vela <vela(at)debian(dot)org>, 380047(at)bugs(dot)debian(dot)org
From: Matej Vela <vela(at)debian(dot)org>
To: submit(at)bugs(dot)debian(dot)org
Date: Thu, 27 Jul 2006 06:45:37 +0200
X-Spam-Status: No, score=2.7 required=4.0 tests=AWL,BAYES_50,
DATE_IN_FUTURE_06_12 autolearn=no version=3.0.3
Package: libpq-dev
Version: 8.1.4-5
Chapter 21.2.3 ("Automatic Character Set Conversion Between Server and
Client") documents several functions:
int PQsetClientEncoding(PGconn *conn, const char *encoding);
where conn is a connection to the server, and encoding is the
encoding you want to use. If the function successfully sets the
encoding, it returns 0, otherwise -1. The current encoding for this
connection can be determined by using:
int PQclientEncoding(const PGconn *conn);
Note that it returns the encoding ID, not a symbolic string such as
EUC_JP. To convert an encoding ID to an encoding name, you can use:
char *pg_encoding_to_char(int encoding_id);
The first two are declared in <libpq-fe.h>, but pg_encoding_to_char()
seems to be in <mb/pg_wchar.h>, which is not included in the package.
If this interface is private or deprecated, consider this a
documentation bug.
Thanks,
Matej
----- End forwarded message -----
--
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntu.com
Debian Developer http://www.debian.org
In a world without walls and fences, who needs Windows and Gates?