Tôi đang cố chạy thử nghiệm đơn vị ở Django và tạo cơ sở dữ liệu mới. Cơ sở dữ liệu có phần mở rộng postgis và khi tôi thường xuyên tạo cơ sở dữ liệu, tôi sử dụng "CREATE EXTENSION postgis".không thể tạo tiện ích mở rộng không có vai trò superuser
Tuy nhiên, khi tôi chạy thử nghiệm, nó mang lại cho tôi những lỗi sau:
$ ./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.
Người sử dụng có Create DB đặc quyền đã có, tôi đang sử dụng PostgreSQL 9.1 trên Ubuntu 12.04 với PostGIS 2.0.
Điều đó có ý nghĩa, không có ý nghĩa trong việc giữ người dùng với đặc quyền superuser, làm giảm bề mặt tấn công. Tôi thích nó! –