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

JF jfkavaka at gmail.com
Tue Jan 24 12:01:01 CET 2006


Nevermind, dumb question, an entry in table usr_preferences with the
same PK already existed from a previous run... :-)

JF

On 1/23/06, JF <jfkavaka at gmail.com> wrote:
> 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