Guest User

Untitled

a guest
Nov 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. t=# create table sd(i int);
  2. CREATE TABLE
  3. t=# insert into sd select 1;
  4. INSERT 0 1
  5. t=# create user nr;
  6. CREATE ROLE
  7. t=# create function s() returns table (i int) as $$
  8. begin
  9. return query select * from sd;
  10. end;
  11. $$ language plpgsql security definer;
  12. CREATE FUNCTION
  13.  
  14. -bash-4.2$ psql -U nr t
  15. psql (9.3.14)
  16. Type "help" for help.
  17.  
  18. t=> select * from sd;
  19. ERROR: permission denied for relation sd
  20. t=> select * from s();
  21. i
  22. ---
  23. 1
  24. (1 row)
Add Comment
Please, Sign In to add comment