Sample Header Ad - 728x90

Issues with setting a global setting in PostgreSQL 9.5/PostGIS2.2

1 vote
2 answers
1382 views
I am trying to set a global setting/GUC variable postgis.gdal_enabled_drivers from the PostGIS extension for a while. I am a non-admin user but can ask admin to change settings if needed. But I tried several different methods following the instructions but none worked. 1. I tried the old fashion way to change environmental variables. I had the following added to /etc/environment: POSTGIS_ENABLE_OUTDB_RASTERS=1 POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL so that echo $POSTGIS_GDAL_ENABLED_DRIVERS returns ENABLE_ALL Now, in my non-admin PostreSQL account, SELECT short_name, long_name FROM ST_GdalDrivers(); returns 0 rows, meaning no GDAL drivers are enabled. 2. I also tried to have postgres to: ALTER SYSTEM SET postgis.gdal_enabled_drivers TO 'ENABLE_ALL'; but I got an error: ERROR: unrecognized configuration parameter "postgis.gdal_enabled_drivers" 3. I tried to: ALTER DATABASE my_db SET postgis.gdal_enabled_drivers TO 'ENABLE_ALL'; but I got: ERROR: permission denied to set parameter "postgis.gdal_enabled_drivers" In sum, I can ask admin to change some settings **once** as in methods 1 and 2, but not every time e.g. when I do a full database restore (method 3). My question is: **How can I make the above methods work?** FYI, my PostgreSQL version is 9.5.1, OS is Lubuntu 16.04 beta postgis_version --------------------------------------- 2.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 In method 3, I can use postgres to ALTER DATABASE but I can't ask amin to do that every time I restore db, where I do something like: dropdb my_db && createdb -T template my_db $$ psql < my_pg_dump_file
Asked by tinlyx (3820 rep)
Mar 30, 2016, 05:21 PM
Last activity: Nov 26, 2016, 06:56 PM