SlideShare a Scribd company logo
Foreign Data Wrappers and You
BRUCE MOMJIAN
April, 2015
This talk explains how foreign data wrappers can be used to
leverage such connectivity.
Creative Commons Attribution License http://momjian.us/presentations
1 / 19
PostgreSQL the database…
Open Source Object Relational DBMS since 1996
Distributed under the PostgreSQL License
Similar technical heritage as Oracle, SQL Server & DB2
However, a strong adherence to standards (ANSI-SQL 2008)
Highly extensible and adaptable design
Languages, indexing, data types, etc.
E.g. PostGIS, JSONB, SQL/MED
Extensive use throughout the world for applications and
organizations of all types
Bundled into Red Hat Enterprise Linux, Ubuntu, CentOS
and Amazon Linux
Foreign Data Wrappers and You 2 / 19
PostgreSQL the community…
Independent community led by a Core Team of six
Large, active and vibrant community
www.postgresql.org
Downloads, Mailing lists, Documentation
Sponsors sampler:
Google, Red Hat, VMWare, Skype, Salesforce, HP and
EnterpriseDB
http://www.postgresql.org/community/
Foreign Data Wrappers and You 3 / 19
EnterpriseDB the company…
The worldwide leader of Postgres based products and
services founded in 2004
Customers include 50 of the Fortune 500 and 98 of the
Forbes Global 2000
Enterprise offerings:
PostgreSQL Support, Services and Training
Postgres Plus Advanced Server with Oracle Compatibility
Tools for Monitoring, Replication, HA, Backup & Recovery
Community
Citizenship
Contributor of key features: Materialized Views, JSON, &
more
Nine community members on staff
Foreign Data Wrappers and You 4 / 19
EnterpriseDB the company…
Foreign Data Wrappers and You 5 / 19
Why use Foreign Data Wrappers
Foreign data wrappers allow SQL access to data in:
Postgres clusters on the same server, perhaps in different
databases or clusters
Remote Postgres servers
Stored in non-Postgres data repositories
Stored in data repositories with different performance and
storage characteristics
Foreign Data Wrappers and You 6 / 19
Foreign Data Wrappers (Database Federation)
Foreign data wrappers (SQL MED) allow queries to read and write
data to foreign data sources. Foreign database support includes:
CouchDB
Hadoop
Informix
MongoDB
MySQL
Neo4j
Oracle
Postgres
Redis
The transfer of joins, aggregates, and sorts to foreign servers is not yet
implemented.
EnterpriseDB Advanced Server’s database links provide similar
functionality for Oracle.
http://www.postgresql.org/docs/current/static/ddl-foreign-data.html
http://wiki.postgresql.org/wiki/Foreign_data_wrappers
Foreign Data Wrappers and You 7 / 19
Foreign Data Wrappers to Interfaces
JDBC
LDAP
ODBC
Foreign Data Wrappers and You 8 / 19
Foreign Data Wrappers to
Non-Traditional Data Sources
Files
HTTP
AWS S3
Twitter
Foreign Data Wrappers and You 9 / 19
Foreign Data Wrapper Example
CREATE SERVER postgres_fdw_test
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host ’localhost’, dbname ’fdw_test’);
CREATE USER MAPPING FOR PUBLIC
SERVER postgres_fdw_test
OPTIONS (password ’’);
CREATE FOREIGN TABLE other_world (greeting TEXT)
SERVER postgres_fdw_test
OPTIONS (table_name ’world’);
det
List of foreign tables
Schema | Table | Server
--------+-------------+-------------------
public | other_world | postgres_fdw_test
(1 row)
Foreign Postgres server name in red; foreign table name in blue
Foreign Data Wrappers and You 10 / 19
Read and Read/Write Data Sources
Postgres
ora_tab
tw_tab
mon_tab
MongoDB
Twitter
Oracle
Foreign Data Wrappers and You 11 / 19
Complex FDW Capabilities
Table restriction pushdown (supported by the postgres_fdw)
Join/aggregate/sort pushdown to FDW sources that support it
Parallel FDW access
Cross-server snapshot synchronization (perhaps possible
with serialization control)
Cross-server transaction durability (possible with two-phase
commit or XA transactions)
Foreign Data Wrappers and You 12 / 19
Foreign Data Wrapper Pushdown (FDW)
SQL Queries
SQL Queries
PG FDW
Foreign Server Foreign Server Foreign Server
Foreign Data Wrappers and You 13 / 19
FDW Sort/Join/Aggregate Pushdown
SQL Queries
SQL Queries
PG FDW
with joins, sorts, aggregates
Foreign Server Foreign Server Foreign Server
Foreign Data Wrappers and You 14 / 19
Parallel FDW Access
SQL Queries
PG FDW
Parallel Queries
Foreign Server Foreign Server Foreign Server
Foreign Data Wrappers and You 15 / 19
Global Snapshot Manager
SQL Queries
SQL Queries
Manager
Global Snapshot
PG FDW
Foreign Server Foreign Server Foreign Server
Foreign Data Wrappers and You 16 / 19
Global Transaction Manager
SQL Queries
SQL Queries
Foreign Server
Manager
Global Transaction
PG FDW
Foreign Server Foreign Server
Foreign Data Wrappers and You 17 / 19
Additional Resources…
Postgres Downloads:
www.enterprisedb.com/downloads
Product and Services information:
info@enterprisedb.com
Foreign Data Wrappers and You 18 / 19
Conclusion
http://momjian.us/presentations http://flickr.com/photos/vpickering/3617513255
Foreign Data Wrappers and You 19 / 19

More Related Content

PDF
10 things, an Oracle DBA should care about when moving to PostgreSQL
PPTX
ProxySQL for MySQL
PDF
PostgreSQL and RAM usage
PPTX
Full Page Writes in PostgreSQL PGCONFEU 2022
PDF
Iceberg + Alluxio for Fast Data Analytics
PDF
Fine-tuning Group Replication for Performance
PDF
Introducing Databricks Delta
PDF
Hive Bucketing in Apache Spark with Tejas Patil
10 things, an Oracle DBA should care about when moving to PostgreSQL
ProxySQL for MySQL
PostgreSQL and RAM usage
Full Page Writes in PostgreSQL PGCONFEU 2022
Iceberg + Alluxio for Fast Data Analytics
Fine-tuning Group Replication for Performance
Introducing Databricks Delta
Hive Bucketing in Apache Spark with Tejas Patil

What's hot (20)

PDF
mysql 8.0 architecture and enhancement
PDF
Mastering PostgreSQL Administration
 
PDF
Vertica 7.0 Architecture Overview
PPTX
Introduction to Aerospike
PDF
From Query Plan to Query Performance: Supercharging your Apache Spark Queries...
PDF
Parquet and AVRO
PDF
NW遅延環境(Paas)でのPostgreSQLの利用について
PPTX
Processing Large Data with Apache Spark -- HasGeek
PDF
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
PDF
Best Practices for Becoming an Exceptional Postgres DBA
 
PPTX
How to Migrate from Oracle to EDB Postgres
PDF
The consequences of sync_binlog != 1
PPT
Les 07 rman_rec
PDF
pg_proctab: Accessing System Stats in PostgreSQL
PDF
Oracle Database Migration to Oracle Cloud Infrastructure
PDF
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
PDF
Evolution of MySQL Parallel Replication
PDF
Oracle RAC 19c and Later - Best Practices #OOWLON
ODP
Introduction to PostgreSQL
PDF
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
mysql 8.0 architecture and enhancement
Mastering PostgreSQL Administration
 
Vertica 7.0 Architecture Overview
Introduction to Aerospike
From Query Plan to Query Performance: Supercharging your Apache Spark Queries...
Parquet and AVRO
NW遅延環境(Paas)でのPostgreSQLの利用について
Processing Large Data with Apache Spark -- HasGeek
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Best Practices for Becoming an Exceptional Postgres DBA
 
How to Migrate from Oracle to EDB Postgres
The consequences of sync_binlog != 1
Les 07 rman_rec
pg_proctab: Accessing System Stats in PostgreSQL
Oracle Database Migration to Oracle Cloud Infrastructure
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Evolution of MySQL Parallel Replication
Oracle RAC 19c and Later - Best Practices #OOWLON
Introduction to PostgreSQL
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Ad

Viewers also liked (9)

PDF
Postgres.foreign.data.wrappers.2015
 
PDF
Writing A Foreign Data Wrapper
PDF
EnterpriseDB Positioned in Leaders Quadrant in Gartner Magic Quadrant
 
PPTX
NoSQL on ACID: Meet Unstructured Postgres
 
PDF
Postgres NoSQL - Delivering Apps Faster
 
PDF
Postgres Foreign Data Wrappers
 
PPT
The NoSQL Way in Postgres
 
PDF
Foreign Data Wrapper Enhancements
PDF
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Postgres.foreign.data.wrappers.2015
 
Writing A Foreign Data Wrapper
EnterpriseDB Positioned in Leaders Quadrant in Gartner Magic Quadrant
 
NoSQL on ACID: Meet Unstructured Postgres
 
Postgres NoSQL - Delivering Apps Faster
 
Postgres Foreign Data Wrappers
 
The NoSQL Way in Postgres
 
Foreign Data Wrapper Enhancements
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Ad

Similar to Foreign Data Wrappers and You with Postgres (20)

PDF
SQL/MED: Doping for PostgreSQL
PPTX
PostgreSQL 9.5 Foreign Data Wrappers
PDF
SQL/MED and PostgreSQL
PDF
Wed roman tut_open_datapub
PDF
Oracle GoldenGate for Oracle DBAs
PDF
Denodo Partner Connect: Technical Webinar - Ask Me Anything
PDF
DFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
PPTX
Publishing Linked Data 3/5 Semtech2011
PPTX
apex-42-in-12c-1970039.pptx apex oracle
PDF
Federated Queries Across Both Different Storage Mediums and Different Data En...
PDF
Postgres Integrates Effectively in the "Enterprise Sandbox"
 
PPTX
Release webinar: Sansa and Ontario
PDF
Oracle NoSQL Database release 3.0 overview
PDF
EKAW - Linked Data Publishing
PPTX
Data Architectures for Robust Decision Making
PDF
Data API as a Foundation for Systems of Engagement
PPTX
Szabaduljon ki az Oracle szorításából
 
PPTX
Evolution of the DBA to Data Platform Administrator/Specialist
PDF
field_guide_to_hadoop_pentaho
PDF
[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...
SQL/MED: Doping for PostgreSQL
PostgreSQL 9.5 Foreign Data Wrappers
SQL/MED and PostgreSQL
Wed roman tut_open_datapub
Oracle GoldenGate for Oracle DBAs
Denodo Partner Connect: Technical Webinar - Ask Me Anything
DFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
Publishing Linked Data 3/5 Semtech2011
apex-42-in-12c-1970039.pptx apex oracle
Federated Queries Across Both Different Storage Mediums and Different Data En...
Postgres Integrates Effectively in the "Enterprise Sandbox"
 
Release webinar: Sansa and Ontario
Oracle NoSQL Database release 3.0 overview
EKAW - Linked Data Publishing
Data Architectures for Robust Decision Making
Data API as a Foundation for Systems of Engagement
Szabaduljon ki az Oracle szorításából
 
Evolution of the DBA to Data Platform Administrator/Specialist
field_guide_to_hadoop_pentaho
[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...

More from EDB (20)

PDF
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
PDF
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
PDF
Migre sus bases de datos Oracle a la nube
 
PDF
EFM Office Hours - APJ - July 29, 2021
 
PDF
Benchmarking Cloud Native PostgreSQL
 
PDF
Las Variaciones de la Replicación de PostgreSQL
 
PDF
NoSQL and Spatial Database Capabilities using PostgreSQL
 
PDF
Is There Anything PgBouncer Can’t Do?
 
PDF
Data Analysis with TensorFlow in PostgreSQL
 
PDF
Practical Partitioning in Production with Postgres
 
PDF
A Deeper Dive into EXPLAIN
 
PDF
IOT with PostgreSQL
 
PDF
A Journey from Oracle to PostgreSQL
 
PDF
Psql is awesome!
 
PDF
EDB 13 - New Enhancements for Security and Usability - APJ
 
PPTX
Comment sauvegarder correctement vos données
 
PDF
Cloud Native PostgreSQL - Italiano
 
PDF
New enhancements for security and usability in EDB 13
 
PPTX
Best Practices in Security with PostgreSQL
 
PDF
Cloud Native PostgreSQL - APJ
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
 
A Journey from Oracle to PostgreSQL
 
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
 
New enhancements for security and usability in EDB 13
 
Best Practices in Security with PostgreSQL
 
Cloud Native PostgreSQL - APJ
 

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Advanced IT Governance
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
madgavkar20181017ppt McKinsey Presentation.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced Soft Computing BINUS July 2025.pdf
Advanced IT Governance
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf

Foreign Data Wrappers and You with Postgres

  • 1. Foreign Data Wrappers and You BRUCE MOMJIAN April, 2015 This talk explains how foreign data wrappers can be used to leverage such connectivity. Creative Commons Attribution License http://momjian.us/presentations 1 / 19
  • 2. PostgreSQL the database… Open Source Object Relational DBMS since 1996 Distributed under the PostgreSQL License Similar technical heritage as Oracle, SQL Server & DB2 However, a strong adherence to standards (ANSI-SQL 2008) Highly extensible and adaptable design Languages, indexing, data types, etc. E.g. PostGIS, JSONB, SQL/MED Extensive use throughout the world for applications and organizations of all types Bundled into Red Hat Enterprise Linux, Ubuntu, CentOS and Amazon Linux Foreign Data Wrappers and You 2 / 19
  • 3. PostgreSQL the community… Independent community led by a Core Team of six Large, active and vibrant community www.postgresql.org Downloads, Mailing lists, Documentation Sponsors sampler: Google, Red Hat, VMWare, Skype, Salesforce, HP and EnterpriseDB http://www.postgresql.org/community/ Foreign Data Wrappers and You 3 / 19
  • 4. EnterpriseDB the company… The worldwide leader of Postgres based products and services founded in 2004 Customers include 50 of the Fortune 500 and 98 of the Forbes Global 2000 Enterprise offerings: PostgreSQL Support, Services and Training Postgres Plus Advanced Server with Oracle Compatibility Tools for Monitoring, Replication, HA, Backup & Recovery Community Citizenship Contributor of key features: Materialized Views, JSON, & more Nine community members on staff Foreign Data Wrappers and You 4 / 19
  • 5. EnterpriseDB the company… Foreign Data Wrappers and You 5 / 19
  • 6. Why use Foreign Data Wrappers Foreign data wrappers allow SQL access to data in: Postgres clusters on the same server, perhaps in different databases or clusters Remote Postgres servers Stored in non-Postgres data repositories Stored in data repositories with different performance and storage characteristics Foreign Data Wrappers and You 6 / 19
  • 7. Foreign Data Wrappers (Database Federation) Foreign data wrappers (SQL MED) allow queries to read and write data to foreign data sources. Foreign database support includes: CouchDB Hadoop Informix MongoDB MySQL Neo4j Oracle Postgres Redis The transfer of joins, aggregates, and sorts to foreign servers is not yet implemented. EnterpriseDB Advanced Server’s database links provide similar functionality for Oracle. http://www.postgresql.org/docs/current/static/ddl-foreign-data.html http://wiki.postgresql.org/wiki/Foreign_data_wrappers Foreign Data Wrappers and You 7 / 19
  • 8. Foreign Data Wrappers to Interfaces JDBC LDAP ODBC Foreign Data Wrappers and You 8 / 19
  • 9. Foreign Data Wrappers to Non-Traditional Data Sources Files HTTP AWS S3 Twitter Foreign Data Wrappers and You 9 / 19
  • 10. Foreign Data Wrapper Example CREATE SERVER postgres_fdw_test FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host ’localhost’, dbname ’fdw_test’); CREATE USER MAPPING FOR PUBLIC SERVER postgres_fdw_test OPTIONS (password ’’); CREATE FOREIGN TABLE other_world (greeting TEXT) SERVER postgres_fdw_test OPTIONS (table_name ’world’); det List of foreign tables Schema | Table | Server --------+-------------+------------------- public | other_world | postgres_fdw_test (1 row) Foreign Postgres server name in red; foreign table name in blue Foreign Data Wrappers and You 10 / 19
  • 11. Read and Read/Write Data Sources Postgres ora_tab tw_tab mon_tab MongoDB Twitter Oracle Foreign Data Wrappers and You 11 / 19
  • 12. Complex FDW Capabilities Table restriction pushdown (supported by the postgres_fdw) Join/aggregate/sort pushdown to FDW sources that support it Parallel FDW access Cross-server snapshot synchronization (perhaps possible with serialization control) Cross-server transaction durability (possible with two-phase commit or XA transactions) Foreign Data Wrappers and You 12 / 19
  • 13. Foreign Data Wrapper Pushdown (FDW) SQL Queries SQL Queries PG FDW Foreign Server Foreign Server Foreign Server Foreign Data Wrappers and You 13 / 19
  • 14. FDW Sort/Join/Aggregate Pushdown SQL Queries SQL Queries PG FDW with joins, sorts, aggregates Foreign Server Foreign Server Foreign Server Foreign Data Wrappers and You 14 / 19
  • 15. Parallel FDW Access SQL Queries PG FDW Parallel Queries Foreign Server Foreign Server Foreign Server Foreign Data Wrappers and You 15 / 19
  • 16. Global Snapshot Manager SQL Queries SQL Queries Manager Global Snapshot PG FDW Foreign Server Foreign Server Foreign Server Foreign Data Wrappers and You 16 / 19
  • 17. Global Transaction Manager SQL Queries SQL Queries Foreign Server Manager Global Transaction PG FDW Foreign Server Foreign Server Foreign Data Wrappers and You 17 / 19
  • 18. Additional Resources… Postgres Downloads: www.enterprisedb.com/downloads Product and Services information: [email protected] Foreign Data Wrappers and You 18 / 19