If I create the following sequence in 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;
And then select the sequence in pgAdmin, right mouse click -> CREATE script, I get:
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;
So in the GRANT statements I see the keyword "TABLE" and not "SEQUENCE"
- Why is that?
- How is pgAdmin generating the DDL extract?
This question is related to one of my other开发者_JAVA百科 questions here:
Query GRANTS granted to a sequence in postgresIn PostgreSQL, sequences are kind of like tables.
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, one of the system catalogs (system tables)
精彩评论