当前位置:网站首页>GBase 8c 创建用户/角色 示例二
GBase 8c 创建用户/角色 示例二
2022-07-03 02:18:00 【大壮十二】
6、创建复制账号:repl
gbase=# CREATE USER repl REPLICATION LOGIN ENCRYPTED PASSWORD 'repl';
CREATE ROLE
7、其他说明
GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
[, ...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...]
| ALL TABLES IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
##单表授权:授权zjy账号可以访问schema为zjy的zjy表grant select,insert,update,delete on zjy.zjy to zjy;
##所有表授权:grant select,insert,update,delete on all tables in schema zjy to zjy;
GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( column_name [, ...] )
[, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
ON [ TABLE ] table_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##列授权,授权指定列(zjy schema下的zjy表的name列)的更新权限给zjy用户grant update (name) on zjy.zjy to zjy;
##指定列授不同权限,zjy schema下的zjy表,查看更新name、age字段,插入name字段grant select (name,age),update (name,age),insert(name) on zjy.xxx to zjy;
GRANT { { USAGE | SELECT | UPDATE }
[, ...] | ALL [ PRIVILEGES ] }
ON { SEQUENCE sequence_name [, ...]
| ALL SEQUENCES IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
##序列(自增键)属性授权,指定zjy schema下的seq_id_seq 给zjy用户grant select,update on sequence zjy.seq_id_seq to zjy;
##序列(自增键)属性授权,给用户zjy授权zjy schema下的所有序列grant select,update on all sequences in schema zjy to zjy;
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [, ...] | ALL [ PRIVILEGES ] }
ON DATABASE database_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##连接数据库权限,授权cc用户连接数据库zjygrant connect on database zjy to cc;
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON DOMAIN domain_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON FOREIGN DATA WRAPPER fdw_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON FOREIGN SERVER server_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
ON { { FUNCTION | PROCEDURE | ROUTINE } routine_name [ ( [ [ argmode ] [ arg_name ] arg_type [, ...] ] ) ] [, ...]
| ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON LANGUAGE lang_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { { SELECT | UPDATE } [, ...] | ALL [ PRIVILEGES ] }
ON LARGE OBJECT loid [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { { CREATE | USAGE } [, ...] | ALL [ PRIVILEGES ] }
ON SCHEMA schema_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##连接schema权限,授权cc访问zjy schema权限grant usage on schema zjy to cc;
GRANT { CREATE | ALL [ PRIVILEGES ] }
ON TABLESPACE tablespace_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON TYPE type_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
where role_specification can be:
[ GROUP ] role_name
| PUBLIC
| CURRENT_USER
| SESSION_USER
GRANT role_name [, ...] TO role_name [, ...] [ WITH ADMIN OPTION ]
##把zjy用户的权限授予用户cc。
grant zjy to cc;
边栏推荐
- Modify table structure
- Leetcode (540) -- a single element in an ordered array
- 单词单词单词
- UDP receive queue and multiple initialization test
- SPI机制
- DML Foundation
- [shutter] shutter debugging (debugging control related functions | breakpoint management | code operation control)
- 基于线程池的生产者消费者模型(含阻塞队列)
- Exception handling in kotlin process
- Swift development learning
猜你喜欢

Trial setup and use of idea GoLand development tool

《上市风云》荐书——唯勇气最可贵

Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)

y54.第三章 Kubernetes从入门到精通 -- ingress(二七)

Solution for processing overtime orders (Overtime unpaid)

What are MySQL locks and classifications

PyTorch 卷积网络正则化 DropBlock

Return a tree structure data
![[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor](/img/06/ab333a4752de27eae2dd937cf579e2.png)
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor

stm32F407-------DMA
随机推荐
詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)
Leetcode (540) -- a single element in an ordered array
leetcode961. Find the elements repeated N times in the array with length 2n
Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)
stm32F407-------DMA
File class (check)
Job object of collaboration in kotlin
Awk from introduction to earth (0) overview of awk
苏世民:25条工作和生活原则
Depth (penetration) selector:: v-deep/deep/ and > > >
Leetcode 183 Customers who never order (2022.07.02)
Recommendation letter of "listing situation" -- courage is the most valuable
String replace space
Cfdiv2 Fixed Point Guessing - (2 points for Interval answer)
Modify table structure
stm32F407-------ADC
GBase 8c系统表pg_database
require. context
DML Foundation