Move sequences' Metadata fields into a newpg_sequence
system catalog (Peter Eisentraut)
A sequence relation now stores only the fields that can be modified bynextval()
,that islast_value
,log_cnt
,andis_called
. Other sequence properties,such as the starting value and increment,are kept in a corresponding row of thepg_sequence
catalog.ALTER SEQUENCE
updates are now fully transactional,implying that the sequence is locked until commit. Thenextval()
andsetval()
functions remain nontransactional.
The main incompatibility introduced by this change is that selecting from a sequence relation now returns only the three fields named above. To obtain the sequence's other properties,applications must look intopg_sequence
. The new system viewpg_sequences
can also be used for this purpose; it provides column names that are more compatible with existing code.
The output ofpsql's\d
command for a sequence has been redesigned,too.