如果我在 Postgres 中创建以下序列:
CREATE SEQUENCE test
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
GRANT ALL ON SEQUENCE test TO testuser;
GRANT SELECT ON SEQUENCE test TO testuser2;
然后在pgAdmin中选择sequence,鼠标右键->CREATE script,我得到:
CREATE SEQUENCE test
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE test
OWNER TO testuser;
GRANT ALL ON TABLE test TO testuser;
GRANT SELECT ON TABLE test TO testuser2;
所以在 GRANT 语句中我看到关键字“TABLE”而不是“SEQUENCE”
- 这是为什么?
- pgAdmin 如何生成 DDL 提取物?
这个问题与我在这里的其他问题之一相关:
Query GRANTS granted to a sequence in postgres
最佳答案
在 PostgreSQL 中,序列有点像表。
The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes (but see also pg_index), sequences, views, composite types, and TOAST tables; see relkind.
PostgreSQL docs for pg_class , 系统目录之一(系统表)
关于sql - 从 pgAdmin 生成的 CREATE 语句中的 GRANT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7341718/