cancel
Showing results for 
Search instead for 
Did you mean: 

PostGis related errors on slave server

When we install the PostGIS extensioon on the master database server the extension will be automatically gets created in the slave server as well.

 

However, you may encounter the below error while checking for its version

 

On master database:

edb=# SELECT PostGIS_Full_Version();

                                                                                                                            postgis_full_version                                         

                                                                                   

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 POSTGIS="2.4.6" PGSQL="100" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.1, released 2015/09/15 GDAL_DATA not found" LIBXML="2.9.4" LIBJSON="0.11" (cor

e procs from "2.4.6" need upgrade) RASTER (raster procs from "2.4.6" need upgrade)

(1 row)

 

On Slave database server:

 

edb=# SELECT PostGIS_Full_Version();

ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory

CONTEXT:  SQL statement "SELECT enterprisedb.postgis_lib_version()"

PL/pgSQL function postgis_full_version() line 25 at SQL statement

edb=# 

 

When the 'PostGIS' extension is created on the master databae server, it also creates some

libraries inbside the $PGLIB ( postgres library directory which will be inside your data directory)

however, those libraries will not be present on the slave server and above error messages can

occur. 

 

Another important scenario is when ever the slave gets promoted as a master there can be issues

with using the PostGIS related functions.

 

To overcome these errors, the PostGIS related files needs to be copied from master to the slave

server after creating the exension on the master database server.

 

3 important files are as follows : postgis-2.4.so   , postgis_topology-2.4.so   , rtpostgis-2.4.so   and you can also

check the dependencies of those files using the "ldd" command after copying them to the slave server.

 

eg: ldd postgis-2.4.so  # If this shows any dependencies are missing they should be also copied to the salve server

 

In our test machine, we have also required below files libgeos* , libproj.so.9 , libgdal*, libjpeg*  , libpng*   which resolved the issue.

eg: scp -r /opt/edb/as10/lib/libgeos*  enterprisedb@<IP ADRESS OF TARGET/SLAVE>:/opt/edb/as10/lib/  

 

Version history
Revision #:
1 of 1
Last update:
‎05-09-2019 09:28 AM
Updated by:
 
Labels (1)
Contributors