5

I have problem of loading GDAL in PostGIS

SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';

After running

ALTER DATABASE "OME"
 SET postgis.gdal_enabled_drivers
 TO 'GTiff PNG JPEG';` 

I still have an error:

rt_raster_to_gdal: Could not load the output GDAL driver

Note that command gdalinfo works. Here is the result executing postgis_full_version() in pgadmin:

POSTGIS="2.1.7 r13414" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014年09月24日 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER

Evan Carroll
7,2592 gold badges34 silver badges67 bronze badges
asked Oct 6, 2016 at 12:27

3 Answers 3

8

Run this SQL command:

SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';
answered May 24, 2017 at 19:53
5

As explained in the PostGIS blog,

This has been an issue since our release of 2.0.6/2.13 PostGIS security patches that by default disabled all raster drivers and out-of-db raster storage. Raster is much less useful if you don’t have any raster drivers enabled, so you need to renable them or the selective ones you need.

The interface you're using is referred to as Grand Unified Custom Variables (GUC). It's a PostGIS 2.2 thing. If using PostGIS 2.1, you do not have GUC, you must set environmental variables corresponding to those options,

As of PostGIS 2.1.3, out-of-db rasters and all raster drivers are disabled by default. In order to re-enable these, you need to set the following environment variables POSTGIS_GDAL_ENABLED_DRIVERS and POSTGIS_ENABLE_OUTDB_RASTERS in the server environment.

answered May 24, 2017 at 18:42
0

Maybe you don't have installed the PostGIS extension. If you use Linux try this command to check that the package is installed:

apt list --installed | grep postgis

If the result is null install PostGIS using this command:

sudo apt-get install postgis

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
answered Jan 2, 2017 at 15:57
1
  • I don't believe that the PostgreSQL DB would know about any GDAL driver unless the PostGIS extension has been activated. Commented Aug 10, 2023 at 12:27

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.