It looks like select nextval('table_name')
actually does the value increment.
My goal is to "predict" the nextval
value on all tables in the database without actually making any incrementation. This should be a read-only operation.
I cannot run the select nextval
on a read-only connection since it's actually trying to make a transaction. I would like to be able to query this and monitor the sequences on a read-only replica database.
How would you tackle this and meet the goal?