Home

FDW

FDW, or foreign data wrapper, is a component of PostgreSQL that enables a database server to query data stored outside of the local database as if it were a local table. FDWs are implemented as extensions that provide the logic for accessing external data sources, translating local SQL into operations understood by the remote system.

In PostgreSQL, the foreign data wrapper architecture consists of several objects. A wrapper defines how to

FDWs can support a range of capabilities. Some wrappers, such as postgres_fdw, allow full read and write

Common use cases include querying remote PostgreSQL databases, accessing non-PostgreSQL databases, and integrating data from files

FDW is defined in PostgreSQL’s SQL/MED standard, introduced to enable federated data access and to provide a

interact
with
a
particular
type
of
external
source,
a
server
represents
a
specific
external
data
source
instance,
and
user
mappings
connect
local
roles
to
credentials
used
on
the
remote
source.
Foreign
tables
route
queries
to
the
appropriate
wrapper
and
server.
Schema
can
be
imported
from
the
remote
source
with
IMPORT
FOREIGN
SCHEMA,
allowing
management
similar
to
local
tables.
operations
and
enable
server-to-server
DML
with
pushdown
of
predicates
and
joins
to
the
remote
source.
Others
are
limited
to
read
access
or
to
specialized
data
types.
The
effectiveness
of
a
query
depends
on
the
wrapper’s
ability
to
push
operations
to
the
remote
source
and
on
network
considerations.
or
other
storage
systems.
Security
is
handled
via
user
mappings
and
role-based
access
control,
with
authentication
and
permissions
managed
per
foreign
server
and
foreign
table.
standardized
approach
for
reading
and,
where
supported,
writing
to
external
data
sources.