Group more closely cache updates for backends in sequence.c

Information of sequences is cached for each backend for currval() and
nextval(), and the update of some cached information was mixed in the
middle of computations based on the other properties of a sequence, for
the increment value in nextval() and the cached state when altering a
sequence.

Grouping them makes the code easier to follow and to refactor in the
future, when splitting the computation and the SeqTable change parts.
Note that the cached data is untouched between the areas where these
cache updates are moved.

Issue noticed while doing some refactoring of the sequence code.

Author: Michael Paquier
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/zwlohtkas0uvv...@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6e951bf98e2e0230ed95db2fafc244536bd7502f

Modified Files
--------------
src/backend/commands/sequence.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Reply via email to