February 2020
Intermediate to advanced
734 pages
38h 13m
English
For this recipe, we have two servers: pg-primary as our main data source and pg-report as a reporting server. As with the previous recipe, we will use pgbench as our sample database. Follow these steps to create a connection from pg-report to pg-primary within pgbench.
CREATE SERVER primary_db
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'pg-primary', dbname 'pgbench');
SELECT srvname, srvoptions FROM pg_foreign_server;
Read now
Unlock full access