postgresql 新创建的库和表授权命令 + 增加唯一键约束

1. postgresql 新创建的库和表授权命令

*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO liujunfan;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO caoxingquan;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO gukaiwei;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO huangpeisi;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO huangrixiong;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO liujiahao;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO ouyuanhui;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO liujiahao;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO yebowei;" 
*/20 * * * * /usr/bin/psql -d  tenant_1011046 -q -t -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO xiejun;" 

 2. 增加唯一键约束

test=# alter table tbl_unique add constraint uk_tbl_unique_a_b unique (a,b);
ALTER TABLE

 

posted @ 2021-08-06 16:53  littlevigra  阅读(897)  评论(0编辑  收藏  举报