pgsql: Group more closely cache updates for backends in sequence.c - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Group more closely cache updates for backends in sequence.c
Date
Msg-id E1reVxc-000oh6-4K@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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/ZWlohtKAs0uVVpZ3@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(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Introduce sequence_*() access functions
Next
From: Alvaro Herrera
Date:
Subject: pgsql: slru.c: Reduce scope of variables in 'for' blocks