<div id="geary-body" dir="auto"><div>This PgSQL table structure</div><div><br></div><div>opensips=# \d dbaliases</div><div>                                       Table "public.dbaliases"</div><div>     Column     |         Type          | Collation | Nullable |                Default                </div><div>----------------+-----------------------+-----------+----------+---------------------------------------</div><div> id             | integer               |           | not null | nextval('dbaliases_id_seq'::regclass)</div><div> alias_username | character varying(64) |           | not null | ''::character varyin
 g</div><div> alias_domain   | character varying(64) |           | not null | ''::character varying</div><div> username       | character varying(64) |           | not null | ''::character varying</div><div> domain         | character varying(64) |           | not null | ''::character varying</div><div>Indexes:</div><div>    "dbaliases_pkey" PRIMARY KEY, btree (id)</div><div>    "dbaliases_alias_idx" UNIQUE CONSTRAINT, btree (alias_username, alias_domain)</div><div>    "dbaliases_target_idx" btree (username, domain)</div><div><br></div><div><br></div><div><br></div><div>volga629 </div></div><div id="geary-quote" dir="auto"><br>On Fri, Nov 15, 2019 at 15:52, johan <johan@democon.be> wrote:<br><blockquote type="cite">
  
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  
  
    <p>That's odd : the primary key is on index and there are no foreign
      keys. <br>
    </p>
    <p>Can you check if you have the same in your db ? <br>
    </p>
    <p><br>
    </p>
    <p>mysql> describe dbaliases;<br>
+----------------+------------------+------+-----+---------+----------------+<br>
      | Field          | Type             | Null | Key | Default |
      Extra          |<br>
+----------------+------------------+------+-----+---------+----------------+<br>
      | id             | int(10) unsigned | NO   | PRI | NULL    |
      auto_increment |<br>
      | alias_username | char(64)         | NO   | MUL |        
      |                |<br>
      | alias_domain   | char(64)         | NO   |     |        
      |                |<br>
      | username       | char(64)         | NO   | MUL |        
      |                |<br>
      | domain         | char(64)         | NO   |     |        
      |                |<br>
+----------------+------------------+------+-----+---------+----------------+<br>
      5 rows in set (0.01 sec)<br>
      <br>
      mysql> SELECT    TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME,
      REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM  
      INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE  
      REFERENCED_TABLE_SCHEMA = 'opensips' AND   REFERENCED_TABLE_NAME =
      'dbaliases';           <br>
      Empty set (0.01 sec)<br>
      <br>
      mysql> <br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 15.11.19 15:31, volga629 via Users
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:1573828293.9239.27@skillsearch.ca">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <div id="geary-body" dir="auto">
        <div>Hello Everyone,</div>
        <div>I am trying use in multi domain environment dbalias table,
          but hit limitation where impossible  insert more then one user
          per domain.</div>
        <div><br>
        </div>
        <div>
          <div>opensips=# INSERT INTO dbaliases (alias_username,
            alias_domain, username, domain) VALUES ('4384783197',
            'dev-sip.networklab.tld', '452392',
            'dev-sip.networklab.tld');</div>
          <div>ERROR:  duplicate key value violates unique constraint
            "dbaliases_alias_idx"</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>We use PgSQL  10</div>
        <div><br>
        </div>
        <div>Any help thank you</div>
        <div>volga629</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  

</blockquote></div>