postgresql 获取 PostGIS 版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4833282/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 22:48:44  来源:igfitidea点击:

Get PostGIS version

postgresqlpostgis

提问by Jason Swett

How can I find out which version of PostGIS I have?

如何找出我拥有哪个版本的 PostGIS?

回答by Nicklas Avén

Since some of the functions depend on other libraries like GEOS and proj4 you might want to get their versions too. Then use:

由于某些函数依赖于 GEOS 和 proj4 等其他库,因此您可能也想获取它们的版本。然后使用:

SELECT PostGIS_full_version();

回答by Jon Conley

Did you try using SELECT PostGIS_version();

你有没有尝试使用 SELECT PostGIS_version();

回答by tino

PostGIS_Lib_Version();- returns the version number of the PostGIS library.

PostGIS_Lib_Version();- 返回 PostGIS 库的版本号。

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

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

回答by Pete Clark

As the above people stated, select PostGIS_full_version(); will answer your question. On my machine, where I'm running PostGIS 2.0 from trunk, I get the following output:

正如上面所说的,选择 PostGIS_full_version(); 会回答你的问题。在我的机器上,我从主干运行 PostGIS 2.0,我得到以下输出:

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)

You do need to care about the versions of PROJ and GEOS that are included if you didn't install an all-inclusive package - in particular, there's some brokenness in GEOS prior to 3.3.2 (as noted in the postgis 2.0 manual) in dealing with geometry validity.

如果您没有安装全包软件包,您确实需要关心包含的 PROJ 和 GEOS 版本 - 特别是在 3.3.2 之前的 GEOS 中存在一些损坏如 postgis 2.0 手册中所述)处理几何有效性。

回答by Matias Barone

Other way to get the minor version is:

获取次要版本的其他方法是:

SELECT extversion
FROM pg_catalog.pg_extension
WHERE extname='postgis'