You could say that that's the same rookie error as relying on the
persistence of any other uncommitted DML ...
IIUC, This is not the same as uncommitted DML exactly. For any uncommitted
DML, it is a rollback for sure. But as for sequence, The xmax is not changed
during sequence's value update by design and we didn't maintain the multi versions
for sequence, so sequence can't be rolled back clearly. The fact is a dirty data page flush
can persist the change no matter the txn is committed or aborted. The below example
can show the difference:
SELECT nextval('s'); -- 1
begin;
SELECT nextval('s'); \watch 0.1 for a while, many checkpointer or data flush happened.
-- crashed.
If we run nextval('s') from the recovered system, we probably will _not_ get
the 2 (assume cachesize=1) like uncommitted DML.