[dev] Error in preferences/database?

Michael Bull mbull@uoguelph.ca
Mon, 13 Nov 2000 17:14:40 -0500


---------------------- multipart/alternative attachment
At 03:21 PM 13/11/2000 -0500, you wrote:
>At 07:28 PM 13/11/2000 +0000, you wrote:
>>My tree is always up-to-date, I only use MySQL however, not Postgres.
>>
>>It sounds like you've set your pref_name to be the primary key
>>for the preferences table, which is wrong - it should be both uid
>>and pref_name together.
>
>That was it.  *thunk*   I changed the primary key on the table and it 
>seems to be working.  I'll let you all know if I run into any further 
>problems with it.   So far though, everything seems to be working well.

Okay, I feel a little better now...  it wasn't that simple afterall!

that didn't actually fix it.  I've gone into my database and the following 
I know:

The following rows are in the table (amongst others);

uid:            user1
pref_name:      signature
pref_value:     Signature for User1

uid:            user2
pref_name:      signature
pref_value:     Signature for User2

uid:            user3
pref_name:      signature
pref_value:     Signature for User3

I can continue to add preferences to create these entries without problem 
(having more than one entry for userid, or for signature, is not a problem).

However, after just creating a signature, and only a signature with user3, 
if I now go to change that signature to "New Signature for User3"...

Warning: PostgreSQL query failed: ERROR: Cannot insert a duplicate key into 
unique index webmail_user_prefs_pkey in DB/pgsql.php on line 163


It sounds as if the code is trying to do an INSERT instead of an UPDATE?


I'll try an update to CVS tomorrow and see if it's still happening, but 
it's seeming as if my database settings are correct?  If anyone has 
anything else they can suggest, please let me know.  If you didn't catch 
this earlier, I'm using Postgres 7 on a RedHat linux 6.2 machine, with IMP 
2.3 of a CVS from around last Wednesday.




Thanks!
Mike.








---------------------- multipart/alternative attachment--