[Users] avpops, duplicate key, empty username and domain

JF jfkavaka at gmail.com
Mon Jan 23 21:01:11 CET 2006


Hi,

I'm trying to use avpops module, but I'm facing the following error:

 0(8178) PG[367] submit_query query 'insert into usr_preferences
(uuid,attribute,value,type,username,domain ) values
('test','avpname','test',0,'','')', result 'ERROR:  duplicate key
violates unique constraint "usr_preferences_pkey"

It seems to be caused by the username and domain parameters being
empty strings, since the usr_preferences table has this PK constraint:
 "usr_preferences_pkey" primary key, btree (attribute, username,
"domain")

The avpops module is configured like this:
modparam("avpops", "avp_url", "postgres://xpto:xpto@127.0.0.1/xpto")
modparam("avpops", "avp_table", "usr_preferences")
modparam("avpops","use_domain",1)
modparam("avpops", "avp_aliases", "avpalias=s:avpname")

And I'm simply doing:
avp_printf("s:avpname", "test");
avp_db_store("$avpalias/uuid", "s:avpname");

What may be missing? Maybe the usr_preferences table should not have
this PK when using UUID-based AVP identification...

JF




More information about the Users mailing list