[{"data":1,"prerenderedAt":125},["ShallowReactive",2],{"term-f\u002Fforeign-data-wrapper":3,"related-f\u002Fforeign-data-wrapper":108},{"id":4,"title":5,"acronym":6,"body":7,"category":89,"description":90,"difficulty":91,"extension":92,"letter":93,"meta":94,"navigation":95,"path":96,"related":97,"seo":102,"sitemap":103,"stem":106,"subcategory":6,"__hash__":107},"terms\u002Fterms\u002Ff\u002Fforeign-data-wrapper.md","Foreign Data Wrapper",null,{"type":8,"value":9,"toc":83},"minimark",[10,15,19,23,26,30,72,76,79],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"A foreign data wrapper lets Postgres pretend a completely different system, another database, a CSV file, even a REST API, is just another local table. You write a normal SELECT, and Postgres quietly reaches across the wire to fetch the real data and hands it back like nothing weird happened.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"A Foreign Data Wrapper (FDW) is a PostgreSQL extension mechanism that exposes external data sources as foreign tables queryable with standard SQL. Popular wrappers like postgres_fdw and mysql_fdw let a single Postgres connection join across systems without building a separate ETL step.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","CREATE EXTENSION postgres_fdw;\nCREATE SERVER remote_db FOREIGN DATA WRAPPER postgres_fdw\n  OPTIONS (host 'other-host', dbname 'analytics');\nCREATE FOREIGN TABLE remote_orders (id int, total numeric)\n  SERVER remote_db OPTIONS (table_name 'orders');\n","sql","",[38,39,40,48,54,60,66],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"CREATE EXTENSION postgres_fdw;\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"CREATE SERVER remote_db FOREIGN DATA WRAPPER postgres_fdw\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"  OPTIONS (host 'other-host', dbname 'analytics');\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"CREATE FOREIGN TABLE remote_orders (id int, total numeric)\n",[41,67,69],{"class":43,"line":68},5,[41,70,71],{},"  SERVER remote_db OPTIONS (table_name 'orders');\n",[11,73,75],{"id":74},"when-youll-hear-this","When You'll Hear This",[16,77,78],{},"\"We used an FDW to join the analytics DB straight from the app database.\" \u002F \"postgres_fdw saved us from building a whole sync pipeline.\"",[80,81,82],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":84},[85,86,87,88],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":74,"depth":50,"text":75},"database","A foreign data wrapper lets Postgres pretend a completely different system, another database, a CSV file, even a REST API, is just another local table.","advanced","md","f",{},true,"\u002Fterms\u002Ff\u002Fforeign-data-wrapper",[98,99,100,101],"PostgreSQL","Reverse ETL","Data Warehouse","SQL",{"title":5,"description":90},{"changefreq":104,"priority":105},"weekly",0.7,"terms\u002Ff\u002Fforeign-data-wrapper","OOoIFUn1pI1ipNG8wKscBPJaAiQvSQm9EpV-pslly3k",[109,113,117,121],{"title":100,"path":110,"acronym":6,"category":89,"difficulty":111,"description":112},"\u002Fterms\u002Fd\u002Fdata-warehouse","intermediate","A data warehouse is where all your company's data goes to be analyzed.",{"title":98,"path":114,"acronym":6,"category":89,"difficulty":115,"description":116},"\u002Fterms\u002Fp\u002Fpostgresql","beginner","PostgreSQL (just say 'Postgres') is the Swiss Army knife of databases.",{"title":99,"path":118,"acronym":6,"category":119,"difficulty":111,"description":120},"\u002Fterms\u002Fr\u002Freverse-etl","backend","Normal ETL pulls messy data out of your apps and pushes it into a tidy warehouse.",{"title":101,"path":122,"acronym":123,"category":89,"difficulty":115,"description":124},"\u002Fterms\u002Fs\u002Fsql","Structured Query Language","SQL is the language you use to talk to a database. You ask it things like 'give me all users who signed up this week' and it actually does it.",1792528085975]