Tutorial by Examples

dblink EXTENSION is a technique to connect another database and make operation of this database so to do that you need: 1-Create a dblink extention: CREATE EXTENSION dblink; 2-Make your operation: For exemple Select some attribute from another table in another database: SELECT * FROM dblink...
FDW is an implimentation of dblink it is more helpful, so to use it: 1-Create an extention: CREATE EXTENSION postgres_fdw; 2-Create SERVER: CREATE SERVER name_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'hostname', dbname 'bd_name', port '5432'); 3-Create user mapping for postgres...
To access complete schema of server db instead of single table. Follow below steps: Create EXTENSION : CREATE EXTENSION postgres_fdw; Create SERVER : CREATE SERVER server_name FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'host_ip', dbname 'db_name', port 'port_numb...

Page 1 of 1