<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    the code for reconnecting to postgress is in the module, but
    implemented only for v2 of DB API. However, kamailio originated
    modules implement v1 of DB API. Will be pretty easy to update DB API
    v1 for a devel that uses postgress. I do not have such devel
    environment setup, but if i find time I will make a patch if others
    are willing to test.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    On 1/4/11 7:44 PM, Javier Gallart wrote:
    <blockquote
      cite="mid:AANLkTikZroyKS7BYKQp8=20_Xv565Kyho0JFLzbupHmA@mail.gmail.com"
      type="cite">Thanks Alex,<br>
      <br>
      it looks like we'll have to move to mysql in that case (we are
      much more experienced in postgres). Is this feature expected to be
      added for db_postgres?<br>
      <br>
      Regards<br>
      <br>
      Javi<br>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <br>
          Message: 6<br>
          Date: Tue, 04 Jan 2011 11:54:20 -0500<br>
          From: Alex Balashov &lt;<a moz-do-not-send="true"
            href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>&gt;<br>
          Subject: Re: [SR-Users] Reconnection to db<br>
          To: <a moz-do-not-send="true"
            href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
          Message-ID: &lt;<a moz-do-not-send="true"
            href="mailto:4D2350BC.8080207@evaristesys.com">4D2350BC.8080207@evaristesys.com</a>&gt;<br>
          Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
          <br>
          On 01/04/2011 09:46 AM, Javier Gallart wrote:<br>
          &gt; Hi list<br>
          &gt;<br>
          &gt; we have been testing the mtree module. We do periodical
          reloads of the<br>
          &gt; mtree table with the "mi mt_reload" command through
          xmlrpc. It works<br>
          &gt; fine except when the db is restarted. If we manually
          restart the db and<br>
          &gt; then try the mt_reload commands we get this error:<br>
          &gt; Jan &nbsp;4 09:13:17 server
          /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
          &gt; ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery
          Error: server<br>
          &gt; closed the connection unexpectedly#012#011This probably
          means the server<br>
          &gt; terminated abnormally#012#011before or while processing
          the request.#012<br>
          &gt; Query: select partition,prefix,route from trees &nbsp;order by
          partition<br>
          &gt; Jan &nbsp;4 09:13:17 server
          /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
          &gt; ERROR: &lt;core&gt; [db_query.c:101]: error while
          submitting query<br>
          &gt; Jan &nbsp;4 09:13:17 server
          /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
          &gt; ERROR: mtree [mtree_mod.c:622]: Error while querying db<br>
          &gt; Jan &nbsp;4 09:13:17 server
          /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
          &gt; ERROR: mtree [mtree_mod.c:738]: cannot re-load info from
          database<br>
          &gt;<br>
          &gt; Is there a way to reconnect to the db before sending that
          command?<br>
          <br>
          Failure to automatically reconnect to Postgres is one of the<br>
          distinguishing features of db_postgres in contrast to db_mysql
          for the<br>
          moment.<br>
          <br>
          --<br>
          Alex Balashov - Principal<br>
          Evariste Systems LLC<br>
          260 Peachtree Street NW<br>
          Suite 2200<br>
          Atlanta, GA 30303<br>
          Tel: +1-678-954-0670<br>
          Fax: +1-404-961-1892<br>
          Web: <a moz-do-not-send="true"
            href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>
          <br>
          <br>
          <br>
          ------------------------------<br>
          <br>
          _______________________________________________<br>
          sr-users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
            target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
          <br>
          <br>
          End of sr-users Digest, Vol 68, Issue 7<br>
          ***************************************<br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>