Erlang/OTP Forums

Author Message

<  Ejabberd mailing list  ~  pgsql & ejabberd (svn trunk)

Guest
Posted: Thu Apr 05, 2007 9:09 am Reply with quote
Guest
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@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
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum