ejabberd - Comments for "ejabberd 2.1.6 with postgres 9" https://www.ejabberd.im/node/4526 en Re https://www.ejabberd.im/node/4526#comment-57067 <div class="quote-msg"> <div class="quote-author"><em>natalius</em> wrote:</div> <p>1. The size of beam file is almost twice size. Not sure has impact or not. </p></div> <p>That is normal: the beam files included in the installer are compressed with some option. Don't worry about the size.</p> <div class="quote-msg"> <div class="quote-author"><em>natalius</em> wrote:</div> <p>2. Your modification code looks like just adding some information only. </p></div> <p>Right, my modification was intended to print debug information.</p> <div class="quote-msg"> <div class="quote-author"><em>natalius</em> wrote:</div> <p>But the result is I can login successfully with the following error. Looks like the source code of pgsql_proto.erl file (included on the windows installer) is not the same with mine.</p> <p>Program Files\ejabberd-2.1.6\lib\pgsql-2009.1102\ebin </p></div> <p>The last change in pgsql driver was done in 2009/11/02, that's the version included in the installer and that's the version you compiled, so it's strange that your compilation works and the initial did not.</p> <p><noindex><a href="https://forge.process-one.net/changelog/ejabberd-modules/pgsql/trunk/src" title="https://forge.process-one.net/changelog/ejabberd-modules/pgsql/trunk/src" rel="nofollow" >https://forge.process-one.net/changelog/ejabberd-modules/pgsql/trunk/src</a></noindex></p> <div class="quote-msg"> <div class="quote-author"><em>natalius</em> wrote:</div> <p>3. The following error. </p></div> <p>Check in the ejabberd Guide the mod_pubsub configuration example that says:<br /> "Using ODBC database requires use of dedicated plugins."</p> Mon, 14 Feb 2011 12:56:32 +0000 mfoss comment 57067 at https://www.ejabberd.im I tried to follow your above https://www.ejabberd.im/node/4526#comment-57062 <p>I tried to follow your above instruction. Here is my steps:</p> <p>1. Download pgsql_proto.erl from <noindex><a href="https://svn.process-one.net/ejabberd-modules/pgsql/trunk/src/pgsql_proto.erl" title="https://svn.process-one.net/ejabberd-modules/pgsql/trunk/src/pgsql_proto.erl" rel="nofollow" >https://svn.process-one.net/ejabberd-modules/pgsql/trunk/src/pgsql_proto...</a></noindex><br /> 2. Compile pgsql_proto.erl by using c(pgsql_proto.erl) on Program Files\ejabberd-2.1.6\bin\werl.exe<br /> 3. Stop ejabberd service<br /> 4. I put the generated beam files to Program Files\ejabberd-2.1.6\lib\pgsql-2009.1102\ebin. The size of pgsql_proto.beam is 12Kb. Comparing with the original one is 6Kb. Not sure why the size has big different.<br /> 5. Start the ejabberd service<br /> 6. The login process is successfull but I receive the following error. I think this error does not impact with the application. Just want to make sure only. Thanks</p> <p>My question:<br /> 1. The size of beam file is almost twice size. Not sure has impact or not.<br /> 2. Your modification code looks like just adding some information only. So basically, I cannot login to ejabberd. But the result is I can login successfully with the following error. Looks like the source code of pgsql_proto.erl file (included on the windows installer) is not the same with mine.<br /> 3. The following error.</p> <p>Thanks for your kind response.</p> <p>=ERROR REPORT==== 2011-02-14 14:35:06 ===<br /> E(&lt;0.356.0&gt;:mod_pubsub_odbc:3624) : transaction return internal error: {aborted,<br /> {undef,<br /> [{node_flat,<br /> get_entity_subscriptions_for_send_last,<br /> ["pubsub.natalius-vaio",<br /> {jid,<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002",<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002"}]},<br /> {mod_pubsub_odbc,<br /> node_call,<br /> 3},<br /> {ejabberd_odbc,<br /> execute_bloc,<br /> 1},<br /> {ejabberd_odbc,<br /> run_sql_cmd,<br /> 4},<br /> {p1_fsm,<br /> handle_msg,<br /> 10},<br /> {proc_lib,<br /> init_p,<br /> 5}]}}</p> <p>=ERROR REPORT==== 2011-02-14 14:35:06 ===<br /> E(&lt;0.356.0&gt;:mod_pubsub_odbc:3624) : transaction return internal error: {aborted,<br /> {undef,<br /> [{node_hometree,<br /> get_entity_subscriptions_for_send_last,<br /> ["pubsub.natalius-vaio",<br /> {jid,<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002",<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002"}]},<br /> {mod_pubsub_odbc,<br /> node_call,<br /> 3},<br /> {ejabberd_odbc,<br /> execute_bloc,<br /> 1},<br /> {ejabberd_odbc,<br /> run_sql_cmd,<br /> 4},<br /> {p1_fsm,<br /> handle_msg,<br /> 10},<br /> {proc_lib,<br /> init_p,<br /> 5}]}}</p> <p>=ERROR REPORT==== 2011-02-14 14:35:06 ===<br /> E(&lt;0.356.0&gt;:mod_pubsub_odbc:3624) : transaction return internal error: {aborted,<br /> {undef,<br /> [{node_pep,<br /> get_entity_subscriptions_for_send_last,<br /> ["pubsub.natalius-vaio",<br /> {jid,<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002",<br /> "admin",<br /> "natalius-vaio",<br /> "40016422031297668906430002"}]},<br /> {mod_pubsub_odbc,<br /> node_call,<br /> 3},<br /> {ejabberd_odbc,<br /> execute_bloc,<br /> 1},<br /> {ejabberd_odbc,<br /> run_sql_cmd,<br /> 4},<br /> {p1_fsm,<br /> handle_msg,<br /> 10},<br /> {proc_lib,<br /> init_p,<br /> 5}]}}</p> Mon, 14 Feb 2011 07:53:20 +0000 natalius comment 57062 at https://www.ejabberd.im ejabberd already received a https://www.ejabberd.im/node/4526#comment-57033 <p>ejabberd already received a change related to PostgreSQL 9 support: <noindex><a href="https://support.process-one.net/browse/EJAB-1359" title="https://support.process-one.net/browse/EJAB-1359" rel="nofollow" >https://support.process-one.net/browse/EJAB-1359</a></noindex></p> <p>Maybe some parts of the code don't yet support 9.</p> <p>Please edit pgsql_proto.erl and replace the function connected with this one, where I've added some io:fomat lines. Compile that file, install, and trigger again the error. Let's hope you get log lines in ejabberd.log and we can debug the problem.</p> <pre> %% Connected state. Can now start to push messages %% between frontend and backend. But first some setup. connected(StateData, Sock) -&gt; %% Protocol unwrapping process. Factored out to make future %% SSL and unix domain support easier. Store process under %% 'socket' in the process dictionary. ResStarted = pgsql_tcp:start_link(Sock, self()), io:format("startedlink: ~n~p~n", [ResStarted]), {ok, Unwrapper} = ResStarted, ResControlled = gen_tcp:controlling_process(Sock, Unwrapper), io:format("controlledprocess: ~n~p~n", [ResControlled]), ok = ResControlled, %% Lookup oid to type names and store them in a dictionary under %% 'oidmap' in the process dictionary. Packet = encode_message(squery, "SELECT oid, typname FROM pg_type"), ResSent = send(Sock, Packet), io:format("sent: ~n~p~n", [ResSent]), ok = ResSent, ResProcessed = process_squery([]), io:format("processsquery: ~n~p~n", [ResProcessed]), {ok, [{"SELECT" ++ _, _ColDesc, Rows}]} = ResProcessed, Rows1 = lists:map(fun ([CodeS, NameS]) -&gt; Code = list_to_integer(CodeS), Name = list_to_atom(NameS), {Code, Name} end, Rows), OidMap = dict:from_list(Rows1), {ok, StateData#state{oidmap = OidMap}}. </pre> Wed, 02 Feb 2011 10:28:24 +0000 mfoss comment 57033 at https://www.ejabberd.im