这是indexloc提供的服务,不要输入任何密码
Skip to content

Improve setval for sequences (RM #5130) #3273

@dpage

Description

@dpage

Issue migrated from Redmine: https://redmine.postgresql.org/issues/5130
Originally created by Jorge Gustavo Rocha at 2020-01-28 23:57:50 UTC.

We can set the sequence value back to 1 using the interface. But if we set the sequence to 1, it will provide the value 2 next time. Using the interface, there is no way to have the sequence back to 1.

It is different:
SELECT setval('foo', 1);
or
SELECT setval('foo', 1, false);

When the user sets the sequence to a given value n, pgAdmin could do:
ALTER SEQUENCE foo RESTART WITH n;
or
SELECT setval('foo', n, false);

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions