ogr_fdw
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1550 | ogr_fdw | No | Yes | No | Yes | No | Yes | - |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.1.9 | 1817161514 | ogr_fdw | - |
| RPM | PGDG | 1.1.9 | 1817161514 | ogr_fdw_$v | - |
| DEB | PGDG | 1.1.9 | 1817161514 | postgresql-$v-ogr-fdw | - |
Install
You can install ogr_fdw directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
ogr_fdw exposes vector data supported by GDAL/OGR as PostgreSQL foreign tables. It can read files and remote data sources through OGR drivers and can write when the selected driver and data source support updates. Install PostGIS before ogr_fdw for native geometry columns; otherwise geometry is exposed as WKB bytea.
Discover and Import a Layer
Use the installed helper to inspect a source and generate matching SQL:
A minimal equivalent definition is:
The PostgreSQL server account needs filesystem permissions for file-backed data sources and network/credential access for remote drivers.
Import and Mapping
ogr_all means all OGR layers. Import normally launders table and column names; use launder_table_names and launder_column_names options when exact remote names are required. A foreign column can map to a different source name with OPTIONS (column_name 'RemoteName').
Important Options and Objects
- Server options: required
datasource, optionalformat,updateable,config_options,open_options, andcharacter_encoding. - Table options:
layeridentifies the OGR layer andupdateablecan disable writes. fididentifies a feature and is required for writable foreign tables.ogr_fdw_infolists drivers and layers and emits server/table definitions.ogr_fdw_version()reports the extension and GDAL version.ogr_fdw_drivers()lists the compiled OGR drivers.
Performance and Write Boundaries
Simple comparisons and bounding-box && predicates can be pushed down, but more complex filters may be evaluated locally. The FDW retrieves all selected source columns and opens two OGR connections per query rather than pooling them. Use EXPLAIN, project only needed columns, and benchmark the actual driver and data source.
Writes depend on driver capability and require source-level write permissions plus fid. Set updateable = false when a source must remain read-only. Version 1.1.9 simplifies the version string relative to 1.1.8 and has no documented SQL workflow change; the control file remains at SQL extension version 1.1.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)