New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy recreated object permissions on update #3109
Merged
mkindahl
merged 1 commit into
timescale:master
from
mkindahl:copy_permissions_on_update
Apr 26, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,21 @@ | |
\d+ _timescaledb_catalog.chunk_index | ||
\d+ _timescaledb_catalog.tablespace | ||
|
||
\z _timescaledb_cache.* | ||
\z _timescaledb_catalog.* | ||
\z _timescaledb_config.* | ||
\z _timescaledb_internal.* | ||
SELECT nspname AS Schema, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should check initprivs as well? Or is that being done some other place? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. No, this is probably the best place. Added a check. |
||
relname AS Name, | ||
unnest(relacl)::text as ACL | ||
FROM pg_class JOIN pg_namespace ns ON relnamespace = ns.oid | ||
WHERE nspname IN ('_timescaledb_catalog', '_timescaledb_config') | ||
ORDER BY Schema, Name, ACL; | ||
|
||
SELECT nspname AS schema, | ||
relname AS name, | ||
unnest(initprivs)::text AS initpriv | ||
FROM pg_class cl JOIN pg_namespace ns ON ns.oid = relnamespace | ||
LEFT JOIN pg_init_privs ON objoid = cl.oid | ||
WHERE classoid = 'pg_class'::regclass | ||
AND nspname IN ('_timescaledb_catalog', '_timescaledb_config') | ||
ORDER BY schema, name, initpriv; | ||
|
||
\di _timescaledb_catalog.* | ||
\ds+ _timescaledb_catalog.*; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- 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. | ||
-- | ||
-- We do not alter the privileges on _timescaledb_internal since this | ||
-- affects both internal objects and two tables that are metadata | ||
-- placed in the _timescaledb_internal schema. | ||
|
||
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 SEQUENCES IN SCHEMA _timescaledb_catalog TO tsdbadmin; | ||
GRANT SELECT ON ALL SEQUENCES IN SCHEMA _timescaledb_config TO tsdbadmin; | ||
|
||
ALTER DEFAULT PRIVILEGES IN SCHEMA _timescaledb_catalog | ||
GRANT SELECT ON tables TO tsdbadmin; | ||
ALTER DEFAULT PRIVILEGES IN SCHEMA _timescaledb_config | ||
GRANT SELECT ON tables TO tsdbadmin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
-- LICENSE-APACHE for a copy of the license. | ||
|
||
CREATE ROLE cagg_user; | ||
CREATE USER tsdbadmin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rewrite the comment a bit so that it is clear 1) we choose chunk table (but it could be any other catalog table
2) The comment about first version can be misinterpreted as version 1.0, and I did. Instead reword it as, -- the first time Timescaledb extension was installed --
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment