In PostgreSQL, you can rollback a transaction and the sequences continue forward.
But then how are the Sequences stored in a durable way? I wanna know how this is implemented (I'm doing an RDBMs) and it looks to me as if exist 2 databases, one for sequences and another for regular tables.
So, it looks like things work this way:
BEGIN TRANSACTION
INSERT table (id, name) values (
next = sequence.next()
COMMIT(sequence)
,
"hello"
);
ROLLBACK TRANSACTION
But how the inner COMMIT not get rolled back?