On Mon, 9 Dec 2019, RW wrote:

On Mon, 09 Dec 2019 13:14:45 +0000
Martin Gregorie wrote:

The primary key for the public.txrep table must be unique, and
evidently you already had a row with the same primary key. It seems
likely that the combination [username, email, signedby and ip] will
very often be duplicated, like every time you get another email from
that person.


TxRep reuses a lot of AWL, often leaving things mislabelled. For per
message tracking entries I think 'email' would be a message identifier
- if such a row already exists it ought be handled. There's no reason
for duplicate reputation entries.

Try this:

Unless you know of a good reason for having duplicates, making it
possible will just conceal a bug.

It's a reputation rating. I'd presume that each tuple *should* only have one entry, updated with more stats (message count, total score, etc.) once it's created.

This sounds more like the "does that tuple already exist?" logic is failing, causing it to think it needs to create a new entry, which the unique key is (correctly) preventing.

You don't lightly bypass unique keys. They are there for a reason.

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 [email protected]    FALaholic #11174     pgpk -a [email protected]
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Any time law enforcement becomes a revenue center, the system
  becomes corrupt.
-----------------------------------------------------------------------
 6 days until Bill of Rights day

Reply via email to