Name

postgis.gdal_enabled_drivers — A configuration option to set the enabled GDAL drivers in the PostGIS environment. Affects the GDAL configuration variable GDAL_SKIP.

Descripción

A configuration option to set the enabled GDAL drivers in the PostGIS environment. Affects the GDAL configuration variable GDAL_SKIP. This option can be set in PostgreSQL's configuration file: postgresql.conf. It can also be set by connection or transaction.

The initial value of postgis.gdal_enabled_drivers may also be set by passing the environment variable POSTGIS_GDAL_ENABLED_DRIVERS with the list of enabled drivers to the process starting PostgreSQL.

Enabled GDAL specified drivers can be specified by the driver's short-name or code. Driver short-names or codes can be found at GDAL Raster Formats. Multiple drivers can be specified by putting a space between each driver.

[Note]

There are three special codes available for postgis.gdal_enabled_drivers. The codes are case-sensitive.

  • DISABLE_ALL disables all GDAL drivers. If present, DISABLE_ALL overrides all other values in postgis.gdal_enabled_drivers.

  • ENABLE_ALL enables all GDAL drivers.

  • VSICURL enables GDAL's /vsicurl/ virtual file system.

When postgis.gdal_enabled_drivers is set to DISABLE_ALL, attempts to use out-db rasters, ST_FromGDALRaster(), ST_AsGDALRaster(), ST_AsTIFF(), ST_AsJPEG() and ST_AsPNG() will result in error messages.

[Note]

In the standard PostGIS installation, postgis.gdal_enabled_drivers is set to DISABLE_ALL.

[Note]

Additional information about GDAL_SKIP is available at GDAL's Configuration Options.

Disponibilidad: 2.2.0

Ejemplos

Set and reset postgis.gdal_enabled_drivers for the current session.

SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';
SET postgis.gdal_enabled_drivers = default;
                

Set specific drivers for all new connections to a database.

ALTER DATABASE mygisdb SET postgis.gdal_enabled_drivers TO 'GTiff PNG JPEG';

Set the default for the whole database cluster to enable all drivers. This requires superuser access. Also note that database, session, and user settings override this.

This example writes the setting to postgres.auto.conf.

ALTER SYSTEM SET postgis.gdal_enabled_drivers TO 'ENABLE_ALL';

Reload the PostgreSQL configuration so the changed setting is applied.

SELECT pg_reload_conf();