Skip to content

Commit

Permalink
Add tests for permissions on catalog tables
Browse files Browse the repository at this point in the history
Test that if users are assigned privileges on tables in the catalog,
these permissions are retained over updates.
  • Loading branch information
mkindahl committed Apr 14, 2021
1 parent 796bf3e commit d99d911
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/sql/updates/setup.catalog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.

-- Catalog tables are occationally rewritten as part of updates, so
-- this is to test that privileges are maintained over updates of the
-- extension. We could verify that other properties (e.g., comments)
-- are maintained here as well, but this is not something we use right
-- now.

GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_catalog TO tsdbadmin;
GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_config TO tsdbadmin;
GRANT SELECT ON ALL TABLES IN SCHEMA _timescaledb_internal TO tsdbadmin;
1 change: 1 addition & 0 deletions test/sql/updates/setup.roles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
-- LICENSE-APACHE for a copy of the license.

CREATE ROLE cagg_user;
CREATE USER tsdbadmin;
1 change: 1 addition & 0 deletions test/sql/updates/setup.v2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.

\ir setup.catalog.sql
\ir setup.bigint.sql
\ir setup.constraints.sql
\ir setup.insert_bigint.v2.sql
Expand Down

0 comments on commit d99d911

Please sign in to comment.