Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select dblink_exec('dbname=mibase host=IP user=usersuport password=xxx',
- 'GRANT SELECT on all tables in schema public to myuser;');
- CREATE EXTENSION postgres_fdw;
- CREATE SERVER servidor_remoto
- FOREIGN DATA WRAPPER postgres_fdw
- OPTIONS (host 'IP', dbname 'mibase');
- CREATE USER MAPPING FOR myuser
- SERVER servidor_remoto
- OPTIONS (user 'usersuport', password 'xxx');
- IMPORT FOREIGN SCHEMA public
- FROM SERVER servidor_remoto
- INTO esquema_public_remoto;
- GRANT SELECT on all tables in schema esquema_public_remoto to myuser;
Add Comment
Please, Sign In to add comment