@@ -173,9 +173,9 @@ DROP SEQUENCE sequence_test;
173173CREATE SEQUENCE foo_seq;
174174ALTER TABLE foo_seq RENAME TO foo_seq_new;
175175SELECT * FROM foo_seq_new;
176- sequence_name | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
177- ---------------+------------+-------------+--------------+---------------------+-----------+-------------+---------+-- ---------+-----------
178- foo_seq | 1 | 1 | 1 | 9223372036854775807 | 1 | 1 | 0 | f | f
176+ last_value | log_cnt | is_called
177+ ------------+ ---------+-----------
178+ 1 | 0 | f
179179(1 row)
180180
181181SELECT nextval('foo_seq_new');
@@ -191,9 +191,9 @@ SELECT nextval('foo_seq_new');
191191(1 row)
192192
193193SELECT * FROM foo_seq_new;
194- sequence_name | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
195- ---------------+------------+-------------+--------------+---------------------+-----------+-------------+---------+-- ---------+-----------
196- foo_seq | 2 | 1 | 1 | 9223372036854775807 | 1 | 1 | 32 | f | t
194+ last_value | log_cnt | is_called
195+ ------------+ ---------+-----------
196+ 2 | 32 | t
197197(1 row)
198198
199199DROP SEQUENCE foo_seq_new;
@@ -536,3 +536,24 @@ SELECT * FROM information_schema.sequences WHERE sequence_name IN
536536
537537DROP USER regress_seq_user;
538538DROP SEQUENCE seq;
539+ -- cache tests
540+ CREATE SEQUENCE test_seq1 CACHE 10;
541+ SELECT nextval('test_seq1');
542+ nextval
543+ ---------
544+ 1
545+ (1 row)
546+
547+ SELECT nextval('test_seq1');
548+ nextval
549+ ---------
550+ 2
551+ (1 row)
552+
553+ SELECT nextval('test_seq1');
554+ nextval
555+ ---------
556+ 3
557+ (1 row)
558+
559+ DROP SEQUENCE test_seq1;
0 commit comments