我试图在Django中运行单元测试,并创建一个新的数据库。数据库有postgis扩展,当我经常创建数据库时,我使用“CREATE EXTENSION postgis”。无法创建扩展没有超级用户角色
然而,当我运行测试,它给了我下面的错误:
$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: database "test_project" already exists
Type 'yes' if you would like to try deleting the test database 'test_project', or 'no' to cancel: yes
Destroying old test database 'default'...
DatabaseError: permission denied to create extension "postgis"
HINT: Must be superuser to create this extension.
用户有创建数据库的权限已经,我使用PostgreSQL 9.1在Ubuntu 12.04在PostGIS 2.0。
这很有道理,保持用户超级用户权限,减少攻击面。我喜欢! – 2016-09-28 13:38:03