当在启用 Potgis 的数据库上创建新用户时,我遇到了一个奇怪的问题:该新用户无法访问 postgis 扩展,而早期创建的用户可以。
使用我的用户帐户,我得到以下输出:
mydb => SELECT postgis_version();
postgis_version
---------------------------------------
2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)
Run Code Online (Sandbox Code Playgroud)
对于新用户,我得到以下信息:
mydb => SELECT postgis_version()
mydb-> ;
ERROR: function postgis_version() does not exist
LINE 1: SELECT postgis_version()
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)
QGIS 还提示我 postgis 未激活:
2018-01-23T16:38:13 1 No PostGIS support in the database.
Run Code Online (Sandbox Code Playgroud)
我正在连接到完全相同的数据库。用户确实有权访问公共模式和geometry_columns 表。
我在这里有点迷失,因为根据我的信息,Postgis 是数据库级别的扩展,它应该适用于所有用户。