Database Reference
In-Depth Information
Foreign Data Wrapper
PostgreSQL 9.1 has a new feature called Foreign Data Wrapper ( FDW ). A foreign data
wrapper is a template to write the module to access foreign data. This is based on the
SQL/MED ( SQL/Management of External Data ) standard. The SQL/MED was added
to the SQL standard in 2003. This is a standard to access remote objects from SQL.
Only postgres_fdw and file_fdw are oficially maintained foreign data wrappers
and part of the PostgreSQL's contrib modules. In this chapter, we will learn how to
use postgres_fdw and file_fdw in detail.
There are many foreign data wrappers available and we can ind the complete list
from the following site:
https://wiki.postgresql.org/wiki/Foreign_data_wrappers .
In this chapter, we will learn about the following:
• How to create a server, user mapping, and foreign tables
• Implementing foreign data wrappers in PostgreSQL
Creating foreign data wrappers
PostgreSQL uses the following syntax for creating foreign data wrappers:
CREATE FOREIGN DATA WRAPPER name
[ HANDLER handler_function | NO HANDLER ]
[ VALIDATOR validator_function | NO VALIDATOR ]
[ OPTIONS ( option 'value' [, ... ] ) ]
Search WWH ::




Custom Search