From: Riley Date: 2001-08-19T07:27:29+09:00 Subject: [ruby-talk:19987] Patching postgres / Noboru Saitou Hello, I'm trying to reach Noboru Saitou, or whoever is now maintaining the postgres module. Can anyone help to reach him, or otherwise step in? --Riley ----- Forwarded message from MAILER-DAEMON@mail5.speakeasy.net ----- : Sorry, I couldn't find any host by that name. (#4.1.2) Hello! I had problems using the postgres module for ruby: it compiled, but produced an unresolved symbol error at load time for "pg_encoding_to_char". Looking into the problem, I discovered that, pg_encoding_to_char is only compiled into libpq if Postgresql is configured with --enable-multibyte. May I propose the following changes (diffs below) to make the library work on systems where postgres has not been compiled with multibyte support? --Riley P.s. I borrowed the CPP define for pg_encoding_to_char from the Postgresql distribution, where several tools make use of it if MULTIBYTE (which is set by configuring with --enable-multibyte) is undefined. --- ruby-postgres-0.6.4/postgres.c Sun Apr 22 19:31:24 2001 +++ ruby-postgres-0.6.4.new/postgres.c Fri Aug 17 06:23:53 2001 @@ -21,6 +21,10 @@ #include #include +#ifndef HAVE_PG_ENCODING_TO_CHAR +#define pg_encoding_to_char(x) "SQL_ASCII" +#endif + static VALUE rb_cPGconn; static VALUE rb_cPGresult; --- ruby-postgres-0.6.4/extconf.rb Sun Mar 4 04:32:43 2001 +++ ruby-postgres-0.6.4.new/extconf.rb Fri Aug 17 06:15:52 2001 @@ -32,6 +32,7 @@ end if have_library("pq", "PQsetdbLogin") have_func("PQsetClientEncoding") + have_func("pg_encoding_to_char") create_makefile("postgres") else puts "Could not find PostgreSQL libraries: Makefile not created" ----- End forwarded message -----