[OpenSIPS-Users] dbalias

johan johan at democon.be
Fri Nov 15 09:52:18 EST 2019


That's odd : the primary key is on index and there are no foreign keys.

Can you check if you have the same in your db ?


mysql> describe dbaliases;
+----------------+------------------+------+-----+---------+----------------+
| Field          | Type             | Null | Key | Default | 
Extra          |
+----------------+------------------+------+-----+---------+----------------+
| id             | int(10) unsigned | NO   | PRI | NULL    | 
auto_increment |
| alias_username | char(64)         | NO   | MUL | |                |
| alias_domain   | char(64)         | NO   |     | |                |
| username       | char(64)         | NO   | MUL | |                |
| domain         | char(64)         | NO   |     | |                |
+----------------+------------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)

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';
Empty set (0.01 sec)

mysql>


On 15.11.19 15:31, volga629 via Users wrote:
> Hello Everyone,
> I am trying use in multi domain environment dbalias table, but hit 
> limitation where impossible  insert more then one user per domain.
>
> opensips=# INSERT INTO dbaliases (alias_username, alias_domain, 
> username, domain) VALUES ('4384783197', 'dev-sip.networklab.tld', 
> '452392', 'dev-sip.networklab.tld');
> ERROR:  duplicate key value violates unique constraint 
> "dbaliases_alias_idx"
>
>
> We use PgSQL  10
>
> Any help thank you
> volga629
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20191115/a2355244/attachment.html>


More information about the Users mailing list