当前位置:网站首页>GBase 8c 访问权限查询函数(五)
GBase 8c 访问权限查询函数(五)
2022-07-24 00:16:00 【大壮十二】
has_table_privilege(table, privilege)
描述:当前用户是否有访问表的权限。
返回类型:Boolean
备注:has_table_privilege检查用户是否以特定方式访问表。用户可以通过名称或OID(pg_authid.oid)来指定,public表明PUBLIC伪角色,或如果缺省该参数,则使用current_user。该表可以通过名称或者OID声明。如果用名称声明,则在必要时可以用模式进行修饰。如果使用文本字符串来声明所希望的权限类型,这个文本字符串必须是SELECT、INSERT、UPDATE、DELETE、TRUNCATE、REFERENCES、TRIGGER、ALTER、DROP、COMMENT、INDEX或VACUUM之一的值。可以给权限类型添加WITH GRANT OPTION,用来测试权限是否拥有授权选项。也可以用逗号分隔列出的多个权限类型,如果拥有任何所列出的权限,则结果便为true。
示例:
gbase=# SELECT has_table_privilege('public.web_site', 'select');
has_table_privilege
---------------------
t
(1 row)
gbase=# SELECT has_table_privilege('gbase', 'public.web_site', 'select,INSERT WITH GRANT OPTION ');
has_table_privilege
---------------------
t
(1 row)has_tablespace_privilege(user, tablespace, privilege)
描述:指定用户是否有访问表空间的权限。
返回类型:Boolean
has_tablespace_privilege(tablespace, privilege)
描述:当前用户是否有访问表空间的权限。
返回类型:Boolean
备注:has_tablespace_privilege检查用户是否能以特定方式访问一个表空间。其参数类似has_table_privilege。访问权限类型必须是CREATE、ALTER、DROP或COMMENT之一的值。
pg_has_role(user, role, privilege)
描述:指定用户是否有角色的权限。
返回类型:Boolean
边栏推荐
- [hcip] OSPF experiment under mGRE environment, including multi process bidirectional republication and OSPF special area
- Solution to the second game of 2022 Niuke multi school league
- 多表查询之_外连接
- Application of encryption technology
- Pytest interface automated testing framework | common running parameters of pytest
- kubernetes error
- How to open an account and buy financial products with 6% income?
- The QT creation window is blocked and cannot be displayed in time
- 作为一个程序员,有什么想对新人说的吗?
- Pytest interface automation test framework | summary
猜你喜欢

L2TP的LAC自动拨号实验

After openfeign sets circuitbreaker=true, feign's readtimeout expires

Super simple training of force deduction and problem brushing
![[attack and defense world web] difficulty five-star 15 point advanced question: bug](/img/24/4a7f074aac9a08130cf215f0c39b57.png)
[attack and defense world web] difficulty five-star 15 point advanced question: bug

Webrtc 1 to 1 - basic architecture and directory

力扣刷题训练之超简单

Summarize the plan, clarify the direction, concentrate and start a new situation -- the Counterpart Assistance Project of hexu software has achieved remarkable results

Jenkins 使用sonarqube构建流水线代码审查项目

Tencent will close the "magic core". Is there any resistance to the development of digital collections?

Take stock of 10 new layer1 to prepare for the next bull market
随机推荐
Why do most people think programming is difficult?
iNFTnews | 呵护“雪山精灵”,42VERSE“数字生态保护”公益项目即将盛启
Copy the customer service wechat, go to wechat to add, and make a call
Xmind用例导入到TAPD的方案(附代码)
mongodb的多数据源配置
JMeter中的自动转义处理
As a programmer, is there anything you want to say to the newcomer?
Thread pool serialization
vulnhub wpwn: 1
Multi knapsack explanation of dynamic programming knapsack problem
Nacos
Deep learning 9 basic concepts of feedforward neural networks
The implementation in Oracle replaces the specified content of the specified column with the desired content
pthread 的 joinable 和 detached
After openfeign sets circuitbreaker=true, feign's readtimeout expires
The name in Qiankun subapplication package.json becomes the default path
Mysql database foundation
YOLOv1
Redis cluster construction (cluster cluster mode, fragment cluster)
inode、软链接、硬链接