[ejabberd] pgsql & ejabberd (svn trunk)

Kevin Jackson foamdino at gmail.com
Thu Apr 5 13:09:47 MSD 2007


Hi,

I've been trying to make a patch against trunk to refactor the sql
queries out of the erlang code.  This is just for my companies
internal use.

I've noticed that the svn trunk version of ejabberd_odbc.erl has a
different arg list for pgsql:connect function calls.

Testing this on my running erlang & ejabberd install with a version
(not sure which but the archive is called 1.0) of pgsql from jungerl I
get the following results:

-SVN Trunk style arg list:
pgsql:connect("localhost", "freelance", "postgres", "", 5432).

=ERROR REPORT==== 5-Apr-2007::15:53:09 ===
Error in process <0.319.0> on node 'ejabberd at ubuntu-dev' with exit
value: {undef,[{pgsql,connect,["localhost","freelance","postgres",[],5432]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}

** exited: {undef,[{pgsql,connect,
                          ["localhost","freelance","postgres",[],5432]},
                   {erl_eval,do_apply,5},
                   {shell,exprs,6},
                   {shell,eval_loop,3}]} **

-Old Ejabberd 1.1.3 style arg list:
pgsql:connect("localhost", "freelance", "postgres", "").

Params: [{secret,{9441,528686832}},
         {{parameter,"TimeZone"},"Asia/Saigon"},
         {{parameter,"standard_conforming_strings"},"off"},
         {{parameter,"session_authorization"},"postgres"},
         {{parameter,"server_version"},"8.1.8"},
         {{parameter,"server_encoding"},"UTF8"},
         {{parameter,"is_superuser"},"on"},
         {{parameter,"integer_datetimes"},"on"},
         {{parameter,"DateStyle"},"ISO, MDY"},
         {{parameter,"client_encoding"},"UTF8"}]
{ok,<0.323.0>}

I guess that the developers already know about this in the trunk
source code, but just in case anyone else is struggling with strange
pgsql errors - yes you can have the pgsql jungerl lib correctly
installed, but the current svn trunk code doesn't work unless you have
the version of pgsql with a 5 arg connect function - which my version
of pgsql doesn't.

So if you're struggling to get pgsql connections working with
ejabberd, try the following from the erlang console :

pgsql:connect("localhost", "freelance", "postgres", "").

if you get a connection, then the problem is that the version of your
pgsql native library is old.

Thanks,
Kev


More information about the ejabberd mailing list