From e6acac3e4bb0282ad4f6cb63e50d73705226cbd1 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 20 Sep 2022 13:08:04 -0400 Subject: [PATCH] link to another postgres server --- postgres/foreign_data_wrapper.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 postgres/foreign_data_wrapper.sql diff --git a/postgres/foreign_data_wrapper.sql b/postgres/foreign_data_wrapper.sql new file mode 100644 index 0000000..6468d40 --- /dev/null +++ b/postgres/foreign_data_wrapper.sql @@ -0,0 +1,14 @@ +CREATE EXTENSION postgres_fdw; + +CREATE SERVER hptrow +FOREIGN DATA WRAPPER postgres_fdw +OPTIONS (host 'hptrow.me', port '54339', dbname 'ubm'); + +CREATE USER MAPPING FOR ptrowbridge +SERVER hptrow +OPTIONS (user 'ptrowbridge', password 'gyaswddh1983'); + +CREATE SCHEMA frlarp; + +IMPORT FOREIGN SCHEMA rlarp +FROM SERVER hptrow INTO frlarp;