Returns the drivers supported by the Ganos_FDW extension and the available options for each driver when connecting to an external data source.
Syntax
setof record ST_FDWDrivers(out integer id ,
out text driver_name ,
out text open_options );Return columns
| Column | Type | Description |
|---|---|---|
id | integer | The driver ID. |
driver_name | text | The driver name. |
open_options | text | The available options for the driver, returned as an XML string. Use this value in the CREATE SERVER statement. |
Usage notes
ST_FDWDrivers is the discovery step in the Ganos_FDW workflow. Call this function to identify the drivers and their available options before creating a foreign server.
The open_options column contains an XML-formatted <OpenOptionList> element. Each <Option> entry has the following attributes:
name: The option key name.type: The value type (string,boolean, orstring-select).description: A description of the option.default(when present): The default value applied if the option is omitted.
Example
The following query filters the driver list to the ESRI Shapefile driver and returns its supported options.
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 ESRI Shapefile driver supports the following options:
| Option name | Type | Default | Description |
|---|---|---|---|
ENCODING | string | — | Overrides the encoding interpretation of the DBF file. Accepts any encoding supported by CPLRecode, or 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 or Integer64 to Integer) where possible. |
ADJUST_GEOM_TYPE | string-select | FIRST_SHAPE | Controls how the layer geometry type is determined. Allowed 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. |