Skip to content
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

allow partitioned table as history table #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion periods--1.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2600,6 +2600,7 @@ BEGIN
SELECT format('REVOKE ALL ON %s %s FROM %s',
CASE object_type
WHEN 'r' THEN 'TABLE'
WHEN 'p' THEN 'TABLE'
WHEN 'v' THEN 'TABLE'
WHEN 'f' THEN 'FUNCTION'
ELSE 'ERROR'
Expand Down Expand Up @@ -3361,6 +3362,7 @@ BEGIN
FOR cmd IN
SELECT format('ALTER %s %s OWNER TO %I',
CASE ht.relkind
WHEN 'p' THEN 'TABLE'
WHEN 'r' THEN 'TABLE'
WHEN 'v' THEN 'VIEW'
END,
Expand Down Expand Up @@ -3446,7 +3448,7 @@ BEGIN
LOOP
IF
r.history_or_portion = 'h' AND
(r.object_type, r.privilege_type) NOT IN (('r', 'SELECT'), ('v', 'SELECT'), ('f', 'EXECUTE'))
(r.object_type, r.privilege_type) NOT IN (('r', 'SELECT'), ('p', 'SELECT'), ('v', 'SELECT'), ('f', 'EXECUTE'))
THEN
RAISE EXCEPTION 'cannot grant % to "%"; history objects are read-only',
r.privilege_type, r.object_name;
Expand Down