[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[],[],null,["# Fine-grained access control for sequences\n\nThis page explains how [fine-grained access control](/spanner/docs/fgac-about) works with\nSpanner sequences for GoogleSQL-dialect databases and PostgreSQL-dialect databases.\n\nFor fine-grained access control users, you can grant either one or both of the\nfollowing privileges to allow access to read sequence information or\ngenerate values from the sequence.\n\n- Grant `SELECT` on the sequence to allow read access to the parameters\n and current state of the sequence.\n\n ### GoogleSQL\n\n ```sql\n GRANT SELECT ON SEQUENCE SEQUENCE_NAME TO ROLE ROLE_NAME;\n ```\n\n ### PostgreSQL\n\n ```sql\n GRANT SELECT ON SEQUENCE SEQUENCE_NAME TO ROLE_NAME;\n ```\n- Grant `UPDATE` on the sequence to allow calls to the sequence value\n generator.\n\n ### GoogleSQL\n\n ```sql\n GRANT UPDATE ON SEQUENCE SEQUENCE_NAME TO ROLE ROLE_NAME;\n ```\n\n ### PostgreSQL\n\n ```sql\n GRANT UPDATE ON SEQUENCE SEQUENCE_NAME TO ROLE_NAME;\n ```\n\nRequired privileges for sequence operations\n-------------------------------------------\n\nThe following table contains details about which privileges you require when\nperforming a specific sequence operations.\n\nWhat's next\n-----------\n\n- Learn more about using [sequences](/spanner/docs/primary-key-default-value#bit-reversed-sequence) in Spanner.\n- Learn about `SEQUENCE` for [GoogleSQL](/spanner/docs/reference/standard-sql/data-definition-language#sequence_statements) or [PostgreSQL](/spanner/docs/reference/postgresql/data-definition-language#sequence_statements).\n- Learn about sequence functions in [GoogleSQL](/spanner/docs/reference/standard-sql/sequence_functions) or [PostgreSQL](/spanner/docs/reference/postgresql/functions-and-operators#sequence).\n- Learn about sequences in the `INFORMATION_SCHEMA` in [GoogleSQL](/spanner/docs/information-schema#sequences) or [PostgreSQL](/spanner/docs/information-schema-pg#sequences)."]]