我正在尝试安装postgis并尝试将其与我的django集成。我在这里学习this教程。上面写着
after connecting to db we need to add geo-extensions:
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
check POSTGIS version:
postgis_lib_version();
as a tupple we add it to django settings:
POSTGIS_VERSION = (2, 1, 3)
我就是这么做的
mst=# \connect school
psql (10.5, server 10.4)
You are now connected to database "school" as user "mst".
school=# CREATE EXTENSION postgis;
CREATE EXTENSION
school=# CREATE EXTENSION postgis_topology;
CREATE EXTENSION
school=# CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION
school=# CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION
school=# postgis_lib_version();
ERROR: syntax error at or near "postgis_lib_version"
LINE 1: postgis_lib_version();
任何关于我为什么会犯这个错误的建议。任何我可能遗漏或做错的事情??你知道吗
调用函数时,函数前面应该有一个
SELECT
,否则PostgreSQL不知道如何处理函数。你知道吗相关问题 更多 >
编程相关推荐