A plain ON CONFLICT DO UPDATE writes the row even when nothing changed — every feed poll rewrites thousands of identical entries, bumping updated_at and burning WAL. One SQL clause, IS DISTINCT FROM, makes Postgres skip the no-op write. The catch: when it skips, RETURNING returns nothing and Ecto raises StaleEntryError. Here is the full pattern, the rescue trick that turns the error into an :unchanged result, and the three-layer RSS dedup strategy it sits inside.
Engineering Blog
Engineering deep-dives from the SlashFeed team — Elixir, Phoenix, and how the product is built.
How SlashFeed turns a blog or news listing page with no RSS feed into a subscribable feed using CSS selectors, Floki, and a small discovery toolkit.
How SlashFeed prevents duplicate RSS entries through a three-layer strategy: GUID uniqueness, SHA-256 content hashing, and a PostgreSQL IS DISTINCT FROM guard that eliminates no-op writes on every fetch cycle.
Current RSS readers are either too bare, too expensive, or drowning in AI features nobody asked for. Here's why I built SlashFeed — and what I'm going to do about it in public.