Ultimate

X_KEYSET_NULL_KEY

Means

a keyset page holds a null in one of its sort keys

Typical cause

a raw read paged with keyset() orders by a nullable column: a row comparison has no null order, so the null rows fall off every page

Fix

keyset({ keys: [{ column: sqlcoalesce(p.published_at, p.created_at), kind: 'timestamptz', direction: 'desc' }, …] }) # or order by a not-null column

Listed under Entity and database

This page as markdown