Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t=# create table sd(i int);
- CREATE TABLE
- t=# insert into sd select 1;
- INSERT 0 1
- t=# create user nr;
- CREATE ROLE
- t=# create function s() returns table (i int) as $$
- begin
- return query select * from sd;
- end;
- $$ language plpgsql security definer;
- CREATE FUNCTION
- -bash-4.2$ psql -U nr t
- psql (9.3.14)
- Type "help" for help.
- t=> select * from sd;
- ERROR: permission denied for relation sd
- t=> select * from s();
- i
- ---
- 1
- (1 row)
Add Comment
Please, Sign In to add comment