Forum OpenACS Q&A: Problems connecting to remote Postgres (multibyte strings)

I'm not sure if this is a PostgreSQL issue or a pgdriver issue.

I'm trying to extend OpenACS to provide reports using data from one
of our older PostgreSQL 6.5.3 databases, but I'm unable to establish
a database connection from the webserver. The error message in the
logs is "Error: Ns_PgOpenDb(postgres):  Could not connect to
bob.somedomain.com:5432:bobsdb:  ERROR:  MultiByte strings (MB) must
be enabled to use this function".

The AOLserver (version 2.3.3) on bob has no problems connecting to
bobsdb. I am using AOLserver 3.4 and pgdriver 2.0 on the OpenACS
server. The PostgreSQL running on bob was originally installed from
the official RH6.2 RPMs.

Any help would be appreciated.

Here are a few things to check:

1.  Be sure that the locale you are running the PG server in, and
the locale you are running AOLserver in, is the same.

2.  Are you sure that 6.5.3 protocol and the latest version of the
driver are compatible?

3.  Look in the server.log for any other messages concerning
postgres.  Are there earlier ones that mention NSModuleInit?

4.  Where did you get the postgres.so?  Did you download it from
somewhere or compile it yourself?

Hi Patrick,

1. Both machines are running in en_US locale.

2. As far as I know, the PostgreSQL client/server protocol has not changed. The psql from the Openacs/PG 7.1.2 server is able to connect to the 6.5.3 database on the other server.

3. There are no other error messages regarding postgres. It is able to access the local openacs database just fine.

4. I compiled it myself from the pgdriver-2.0 source, using the PG 7.1.2 libraries and headers.

I'm going to try compiling a PG 6.5.3 on the openacs machine and build a second postgres driver using the 6.5.3 libraries and headers. Maybe that'll work.

Oops. I just discovered that someone had previously installed Postgres 7.0 from RPMs and that the pgdriver was using 7.0's shared library. Uninstalling PG 7.0 and explicitly listing the 7.1.2 shared library directory in LD_LIBRARY_PATH seems to have fixed the problem.