create or replace view loses grants on the view
create schema gwtest; create table gwtest.x (a int); create view gwtest.y as select * from gwtest.x; grant usage on schema gwtest to zenpm; grant select on gwtest.y to someuser; grant usage on schema gwtest to someuser; select * from grants where object_schema='gwtest'; grant_id | grantor_id | grantor | privileges_description | object_schema | object_name | object_id | object_type | grantee_id | grantee -------------------+-------------------+---------+-------------------------------------------------+---------------+-------------+-------------------+-------------+-------------------+--------- 45035998801266060 | 45035996273704962 | dbadmin | INSERT*, SELECT*, UPDATE*, DELETE*, REFERENCES* | gwtest | y | 45035998801266054 | VIEW | 45035996273704962 | dbadmin 45035998801266062 | 45035996273704962 | dbadmin | SELECT | gwtest | y | 45035998801266054 | VIEW | 67553994410572054 | someuser create or replace view gwtest.y as select *, 2 from gwtest.x; select * from grants where object_schema='gwtest'; grant_id | grantor_id | grantor | privileges_description | object_schema | object_name | object_id | object_type | grantee_id | grantee ----------+------------+---------+------------------------+---------------+-------------+-----------+-------------+------------+--------- I'd expect the grants to be maintained when executing create or replace view. This suggests that internally this is implemented as drop view; create view. Vertica doesn't appear to provide an ALTER VIEW variant that allows a view's definition to be changed, so I've used CREATE OR REPLACE VIEW to fit that purpose.
0
Comments