AIOps 一场颠覆传统运维的盛筵
894
2022-09-27
PostgreSQL运维—REASSIGN OWNED
postgres=# create user u1;CREATE ROLEpostgres=# create user u2;CREATE ROLEpostgres=# create table t1 (id int);CREATE TABLEpostgres=# \c - u1You are now connected to database "postgres" as user "u1".postgres=> select * from t1;ERROR: permission denied for table t1postgres=# \c - u2You are now connected to database "postgres" as user "u2".postgres=> select * from t1;ERROR: permission denied for table t1postgres=> \c - postgresYou are now connected to database "postgres" as user "postgres".postgres=# grant select on t1 to u1;GRANTpostgres=# \c - u1You are now connected to database "postgres" as user "u1".postgres=> select * from t1; id ----(0 rows)postgres=> \c - postgresYou are now connected to database "postgres" as user "postgres".postgres=# reassign owned by u1 to u2;REASSIGN OWNEDpostgres=# \c - u2You are now connected to database "postgres" as user "u2".postgres=> select * from t1; id ----(0 rows)postgres=>
发表评论
暂时没有评论,来抢沙发吧~