Last active
July 14, 2017 22:08
-
-
Save xxx/ec3b35b83d07ef1d37a4af819723842b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE SCHEMA staging; | |
CREATE EXTENSION postgres_fdw; | |
CREATE SERVER staging FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'hostname', dbname 'dbname', port'5432'); | |
CREATE USER MAPPING FOR CURRENT_USER SERVER staging OPTIONS (user 'username', password 'password'); | |
IMPORT FOREIGN SCHEMA public FROM SERVER staging INTO staging; | |
-- CREATE TABLE public.lol AS SELECT * from staging.users where <whatever>... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment