Urgent.News

What's breaking now, across thousands of outlets.

Tech

A created_at-only cursor lost 587 rows, even with clock_timestamp() and microseconds

A reader on one of my Postgres posts asked a fair question: why put id in the pagination index at all? With clock_timestamp() instead of now() , it's hard to create two rows at exactly the same time. So I measured it. The setup PostgreSQL 16, a 4-vCPU machine. The table is the one every app has: CREATE TABLE concurrent ( id bigserial PRIMARY KEY , created_at timestamptz NOT NULL DEFAULT…

A reader inquired about the need for an `id` column in a pagination index. The author measured the effect of using `clock_timestamp()` instead of `now()` in a PostgreSQL 16 environment. The table was filled with concurrent inserts and a bulk insert. The author found that using only the timestamp column for pagination resulted in rows being lost.

This was because when the cursor ended on a timestamp shared by other rows, those other rows were skipped on the next request. Adding the `id` column to the cursor and ordering by both timestamp and `id` resolved the issue, as the tuple comparison `(created_at, id)` ensured each row was returned uniquely. The author suggests encoding the timestamp and a unique tiebreaker in the cursor, and testing for any missing rows in the table.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Catastrophizing About Production Outages: A CBT Thought Record for On-Call Engineers

Catastrophizing About Production Outages: A CBT Thought Record for On-Call Engineers Published on Dev.to | Tags: cbt, mentalhealth, productivity, webdev You're on call. PagerDuty fires at 2 AM.

  • On-call engineers experience cognitive distortions like catastrophizing outage impact
  • Thought Record technique helps identify and reframe anxious thoughts
  • CBT for on-call engineering alleviates anxiety and improves performance

Detection planning for CVE-2026-79851 without invented signatures

Detection planning for CVE-2026-79851 without invented signatures Detection teams often receive a critical CVE without the technical detail needed to write a precise exploit signature.

  • CVE-2026-79851 is an unauthenticated buffer overflow vulnerability in Aruba AOS-10 switches.
  • Detection plan uses trusted inventory, live images, roles, and management addresses.
  • Restrict CLI and web management interfaces to dedicated network segment.

More from Thursday 12 November →