commitNewEntries should ignore conflicting keys on migration from ent…#1613
Conversation
…rytmp to entry Fixes FreshRSS#1610 by first ignoring all entries from entrytmp which exists already inside the entry table.
|
Looks good, thanks 👍 |
app/Models/EntryDAOPGSQL.php
Outdated
| (SELECT rank + row_number() OVER(ORDER BY date) AS id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags FROM `' . $this->prefix . 'entrytmp` ORDER BY date); | ||
| (SELECT rank + row_number() OVER(ORDER BY date) AS id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags | ||
| FROM `' . $this->prefix . 'entrytmp` AS entrytmp | ||
| WHERE NOT EXISTS (SELECT 1 FROM `' . $this->prefix . 'entry` AS entry WHERE entrytmp.id_feed = entry.id_feed AND entrytmp.guid = entry.guid) |
There was a problem hiding this comment.
Please change the name of the aliases just like you did in 0d51b68
|
P.S.: @Trim, putting your name in the Credits file was just a suggestion; no problem if you do not want :-) |
|
Oh, I didn't see your first comment, I'll add a commit to this PR. Note, that I tried to run this modification on my server and I run into a related issue: I have an RSS feed containing two articles with same URI: http://www.geany.org/Main/HomePage?action=blogrss contains two articles with URI http://www.geany.org/Main/20170717 (the latest two). This issue continue to rise a PostgreSQL error, but it didn't block all the transaction: Now, I don't know two thing:
|
|
Thanks for the other related issue. For the time being, I would suggest to add the same |
|
I've just understood the log message with your comment: So this pull request still make sense and I still understand transactions :) PS: I updated changelog and contributors files |
|
Indeed, during the discovery of new articles (that is when articles are added to the temporary table), there is one transaction by feed. Then, when committing to the main table, there is one single transaction for all new articles. |
|
@Trim Could you please open a new issue for the related problem you reported above? #1613 (comment) |
…rytmp to entry
Fixes #1610 by first ignoring all entries from entrytmp which exists
already inside the entry table.