ST_FDWDrivers returns a list of drivers supported by the Ganos_FDW (foreign data wrapper) extension. Use the results to identify available data format drivers and retrieve their open_options values for use in a CREATE SERVER statement.
Syntax
setof record ST_FDWDrivers(out integer id,
out text driver_name,
out text open_options);Parameters
| Parameter | Description |
|---|---|
id | The driver ID. |
driver_name | The driver name. |
open_options | The options available when opening a data source. Pass these values in the OPTIONS clause of a CREATE SERVER statement. |
Examples
List all drivers
SELECT * FROM
(SELECT (ST_FDWDrivers()).*) t;Query a specific driver
Filter by driver_name to retrieve the open_options for a particular format:
SELECT * FROM
(SELECT (ST_FDWDrivers()).*) table_test
WHERE driver_name = 'ESRI Shapefile';Output:
id | driver_name | open_options
4 | ESRI Shapefile | <OpenOptionList> <Option name='ENCODING' type='string' description='to override the encoding interpretation of the DBF with any encoding supported by CPLRecode or to "" to avoid any recoding'/> <Option name='DBF_DATE_LAST_UPDATE' type='string' description='Modification date to write in DBF header with YYYY-MM-DD format'/> <Option name='ADJUST_TYPE' type='boolean' description='Whether to read whole .dbf to adjust Real->Integer/Integer64 or Integer64->Integer field types if possible' default='NO'/> <Option name='ADJUST_GEOM_TYPE' type='string-select' description='Whether and how to adjust layer geometry type from actual shapes' default='FIRST_SHAPE'> <Value>NO</Value> <Value>FIRST_SHAPE</Value> <Value>ALL_SHAPES</Value> </Option> <Option name='AUTO_REPACK' type='boolean' description='Whether the shapefile should be automatically repacked when needed' default='YES'/> <Option name='DBF_EOF_CHAR' type='boolean' description='Whether to write the 0x1A end-of-file character in DBF files' default='YES'/></OpenOptionList>
(1 row)The open_options column returns an XML string. The key options for the ESRI Shapefile driver are:
| Option | Type | Default | Description |
|---|---|---|---|
ENCODING | string | — | Overrides the encoding interpretation of the DBF file. Set to "" to skip recoding. |
DBF_DATE_LAST_UPDATE | string | — | Modification date written to the DBF header, in YYYY-MM-DD format. |
ADJUST_TYPE | boolean | NO | Reads the entire .dbf to adjust field types (for example, Real to Integer) when possible. |
ADJUST_GEOM_TYPE | string-select | FIRST_SHAPE | Determines how the layer geometry type is computed. Valid values: NO, FIRST_SHAPE, ALL_SHAPES. |
AUTO_REPACK | boolean | YES | Automatically repacks the shapefile when needed. |
DBF_EOF_CHAR | boolean | YES | Writes the 0x1A end-of-file character in DBF files. |