Guest User

Untitled

a guest
Nov 28th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. select dblink_exec('dbname=mibase host=IP user=usersuport password=xxx',
  2. 'GRANT SELECT on all tables in schema public to myuser;');
  3.  
  4. CREATE EXTENSION postgres_fdw;
  5.  
  6. CREATE SERVER servidor_remoto
  7. FOREIGN DATA WRAPPER postgres_fdw
  8. OPTIONS (host 'IP', dbname 'mibase');
  9.  
  10. CREATE USER MAPPING FOR myuser
  11. SERVER servidor_remoto
  12. OPTIONS (user 'usersuport', password 'xxx');
  13.  
  14. IMPORT FOREIGN SCHEMA public
  15. FROM SERVER servidor_remoto
  16. INTO esquema_public_remoto;
  17.  
  18. GRANT SELECT on all tables in schema esquema_public_remoto to myuser;
Add Comment
Please, Sign In to add comment