<p>Bogdan, look please at this solution. If it's correct, I'll patch all supported previous versions.</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/nikbyte/opensips master</pre>
<p>Or view, comment on, or merge it at:</p>
<p>&nbsp;&nbsp;<a href='https://github.com/OpenSIPS/opensips/pull/218'>https://github.com/OpenSIPS/opensips/pull/218</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>PostgreSQL DB schema: remove bytea size because pgsql has no fixed size for this type of field</li>
  <li>PostgreSQL DB schema: set for all serials maxvalue and cycle because sometimes serials may overflow</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-0">doc/dbschema/xsl/postgres.xsl</a>
    (28)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-1">scripts/postgres/acc-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-2">scripts/postgres/alias_db-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-3">scripts/postgres/auth_db-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-4">scripts/postgres/avpops-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-5">scripts/postgres/b2b-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-6">scripts/postgres/b2b_sca-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-7">scripts/postgres/call_center-create.sql</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-8">scripts/postgres/carrierroute-create.sql</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-9">scripts/postgres/closeddial-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-10">scripts/postgres/cpl-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-11">scripts/postgres/dialog-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-12">scripts/postgres/dialplan-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-13">scripts/postgres/dispatcher-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-14">scripts/postgres/domain-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-15">scripts/postgres/domainpolicy-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-16">scripts/postgres/drouting-create.sql</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-17">scripts/postgres/group-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-18">scripts/postgres/imc-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-19">scripts/postgres/load_balancer-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-20">scripts/postgres/msilo-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-21">scripts/postgres/pdt-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-22">scripts/postgres/permissions-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-23">scripts/postgres/presence-create.sql</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-24">scripts/postgres/registrant-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-25">scripts/postgres/registrar-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-26">scripts/postgres/rls-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-27">scripts/postgres/rtpproxy-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-28">scripts/postgres/siptrace-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-29">scripts/postgres/speeddial-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-30">scripts/postgres/uri_db-create.sql</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-31">scripts/postgres/userblacklist-create.sql</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/218/files#diff-32">scripts/postgres/usrloc-create.sql</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/218.patch'>https://github.com/OpenSIPS/opensips/pull/218.patch</a></li>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/218.diff'>https://github.com/OpenSIPS/opensips/pull/218.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/pull/218'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNDYzNzUwOCwiZGF0YSI6eyJpZCI6MzEyOTQzNjh9fQ==--43e5d131c08b1dc48d029489e474361fb10e4807.gif' height='1' width='1'></p>