Obtener la versión PostGIS


¿Cómo puedo saber qué versión de PostGIS tengo?

Author: Jason Swett, 2011-01-29

5 answers

Dado que algunas de las funciones dependen de otras bibliotecas como GEOS y proj4, es posible que también desee obtener sus versiones. Luego use:

SELECT PostGIS_full_version();
 280
Author: Nicklas Avén,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-28 20:19:28

¿Has intentado usar SELECT PostGIS_version();

 31
Author: Jon Conley,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-15 15:52:08

PostGIS_Lib_Version(); - devuelve el número de versión de la biblioteca PostGIS.

Http://postgis.refractions.net/docs/PostGIS_Lib_Version.html

 13
Author: tino,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-09-28 18:16:50

Como las personas mencionadas anteriormente, seleccione PostGIS_full_version(); responderá a su pregunta. En mi máquina, donde estoy ejecutando PostGIS 2.0 desde trunk, obtengo la siguiente salida:

postgres=# select PostGIS_full_version();
postgis_full_version                                                                  
-------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="2.0.0alpha4SVN" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.8.1, released 2011/07/09" LIBXML="2.7.3" USE_STATS
(1 row)

Necesita preocuparse por las versiones de PROJ y GEOS que se incluyen si no instaló un paquete todo incluido-en particular, hay algo de quebrantamiento en GEOS antes de 3.3.2 (como se indica en el manual de postgis 2.0) al tratar con la validez de la geometría.

 9
Author: Pete Clark,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-02-06 16:54:59

Otra forma de obtener la versión menor es:

SELECT extversion
FROM pg_catalog.pg_extension
WHERE extname='postgis'
 5
Author: Matias Barone,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-27 12:38:19