当前位置:网站首页>Similarities and differences between the defined identity execution function authid determiner and PostgreSQL in Oracle
Similarities and differences between the defined identity execution function authid determiner and PostgreSQL in Oracle
2022-07-01 23:28:00 【mingjie73】
Oracle Behavior
Oracle The function in can define the execution function body , Which user's permissions are used :
[AUTHID { CURRENT_USER|DEFINER}]
CURRENT_USER The function body has been executed as the current user
DEFINER The identity of the defined person executes the function body
CASE1: For example, the following function will use the current user to execute the function body , If the current user is on tbl1 Read permission can be successfully executed .
CREATE OR REPLACE PROCEDURE TEST_P AUTHID CURRENT_USER IS
BEGIN
EXECUTE IMMEDIATE 'select * from tbl1';
END TEST_P;
CASE2: The following function will use the user who defines the function to execute the function body , If the user who defines the function is right tbl1 Read permission can be successfully executed .
CREATE OR REPLACE PROCEDURE TEST_P AUTHID DEFINER IS
BEGIN
EXECUTE IMMEDIATE 'select * from tbl1';
END TEST_P;
PG Behavior
PG The execution function in is always executed with the permission of the current user , similar Oracle in AUTHID CURRENT_USER The concept of .
for example user1 Create table
drop table u1tbl;
create table u1tbl(i int);
insert into u1tbl values (123);
user2 Query without permission
postgres=> select * from u1tbl;
ERROR: permission denied for table u1tbl
user1 Create a function
drop function f1();
CREATE OR REPLACE FUNCTION f1() RETURNS int AS $$
DECLARE
id int;
BEGIN
select i into id from u1tbl;
return id;
END;
$$ LANGUAGE plpgsql;
user2 Execute function
postgres=> select f1();
ERROR: permission denied for table u1tbl
CONTEXT: SQL statement "select i from u1tbl"
PL/pgSQL function f1() line 5 at SQL statement
so PG There is no such way to implement the defined identity .
边栏推荐
- Matplotlib common settings
- 股票开户哪个证券公司最好,有安全保障吗
- Know --matplotlib
- 2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
- Notes to problems - file /usr/share/mysql/charsets/readme from install of mysql-server-5.1.73-1 glibc23.x86_ 64 c
- Yunxin small class | common cognitive misunderstandings in IM and audio and video
- Who do you want to know when opening a stock account? Is it safe to open an account online?
- 物联网现状及未来发展趋势
- CADD course learning (3) -- target drug interaction
- Glass mosaic
猜你喜欢

硅谷产品实战学习感触
![[micro service sentinel] sentinel integrates openfeign](/img/8b/46156255fd980eb422c7e05d5af7ee.png)
[micro service sentinel] sentinel integrates openfeign

2022年起重机司机(限桥式起重机)考试试题及模拟考试

Istio, ebpf and rsocket Broker: in depth study of service grid

2021 RoboCom 世界机器人开发者大赛-本科组初赛

Airserver latest win64 bit personal screen projection software

ARP报文头部格式和请求流程
![Jielizhi Bluetooth headset quality control and production skills [chapter]](/img/ad/28e7461f8c5dc5c54a3f4da0c111ac.png)
Jielizhi Bluetooth headset quality control and production skills [chapter]

De PIP. Interne. CLI. Main Import main modulenotfounderror: No module named 'PIP'

CKS CKA ckad change terminal to remote desktop
随机推荐
The digital summit is popular, and city chain technology has triggered a new round of business transformation
What is the relationship between modeling and later film and television?
【必会】BM41 输出二叉树的右视图【中等+】
mt管理器测试滑雪大冒险
Distance measurement - Hamming distance
Which securities company is better and which is safer to open a securities account
力扣今日题-241. 为运算表达式设计优先级
What is the difference between memory leak and memory overflow?
Win 10 mstsc connect RemoteApp
Why is PHP called hypertext preprocessor
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
【微服务|Sentinel】SentinelResourceAspect详解
Redis数据类型和应用场景
2022 safety officer-c certificate examination question simulation examination question bank and simulation examination
通过Go语言创建CA与签发证书
每日三题 6.30(2)
Behind sharing e-commerce: the spirit of CO creation, symbiosis, sharing, CO prosperity and win-win
Daily three questions 6.30
距离度量 —— 汉明距离(Hamming Distance)
2022年起重机司机(限桥式起重机)考试试题及模拟考试