Today I Learned

A Hashrocket project

pg_dump can dump foreign table schemas

pg_dump will dump foreign tables schemas, but not their data.

$ pg_dump -d db_with_foreign_tables
CREATE FOREIGN TABLE public.users (
  name text,
  ...
)
SERVER foreign_server_somewhere
OPTIONS (
  query 'select * from foreign_users'
);
Looking for help? Hashrocket developers believe that data quality is as important as code quality. We enjoy all the challenges of relational databases, from finding the fastest index, to structuring data to fit the needs of an application. We're eager to share our experiences; check out PG Casts, our series of free PostgreSQL screencasts.