pgarchives: Bug report + Patches: loader can't handle message in multiple lists - Mailing list pgsql-www

From Célestin Matte
Subject pgarchives: Bug report + Patches: loader can't handle message in multiple lists
Date
Msg-id ed72a307-e40f-98b9-d08a-e5bf331525ae@cmatte.me
Whole thread Raw
Responses Re: pgarchives: Bug report + Patches: loader can't handle message in multiple lists  (Magnus Hagander <magnus@hagander.net>)
List pgsql-www
The messages loader from pgarchives may crash when importing 2 mailing lists with messages in common. In another word:
importingscript will fail when importing list1 and list2 if a message to list1 has list2 in CC:.
 

I attach a patch (0001-loader-attempt-to-handle-message-in-multiple-lists.patch) that starts addressing the issue, but
doesnot fully fixes it, as the script can later crash (in storage.py line 234) because a message cannot be imported
twice.Fixing this would require changing the way messages are stored in the database, using (messageid, listid) as a
primarykey instead of messageid, or allowing a message to belong to several threads using message_thread table instead
ofa threadid column in messages.
 
This patch is only for discussion.

I also attach patch 0001-load_message-catch-postgres-UniqueViolation-errors-w.patch as a workaround to this issue, to
catchand log such errors and keep importing an mbox without crashing when it happens (message will then only appear in
thefirst imported list).
 
This patch can be used/applied.
-- 
Célestin Matte
Attachment

pgsql-www by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: missing files because versioning?
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences