PostgreSQL – Why Grant Update on Sequence

permissionspostgresqlsequence

I have seen postgresql allowing users to Grant update on a sequence. But never seen any update query on the sequence.
Sequence values are usually changed using ALTER SEQUENCE command. I understand the need for GRANT USAGE and GRANT SELECT on sequences. But what exactly does a GRANT UPDATE on a sequence lets you do in PostgreSQL.

Best Answer

The documentation says:

nextval ( regclass )bigint

[...]
This function requires USAGE or UPDATE privilege on the sequence.


setval ( regclass, bigint [, boolean ] )bigint

[...]
This function requires UPDATE privilege on the sequence.