Skip to content

Instantly share code, notes, and snippets.

@Sillson
Created February 14, 2017 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sillson/60e08ce26412ad4334baaa001926370d to your computer and use it in GitHub Desktop.
Save Sillson/60e08ce26412ad4334baaa001926370d to your computer and use it in GitHub Desktop.
Create a foreign data connection in postgres
CREATE SERVER [SERVER_NAME]
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '[YOUR_HOST]', port '[PORT]', dbname '[DB_NAME]', sslmode 'require');
CREATE USER MAPPING FOR [DB_USER]
SERVER [SERVER_NAME]
OPTIONS (user '[FOREIGN_USER]', password '[FOREIGN_PW]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment