permission denied to create extension “hstore”解决方案

ROR app中 安装postgres

rake db:migrate 后出现下面错误:

PG::InsufficientPrivilege: ERROR:  permission denied to create extension "hstore"
HINT:  Must be superuser to create this extension.
: CREATE EXTENSION IF NOT EXISTS hstore

解决方案:

sudo su postgres -c "psql db_name -c'CREATE EXTENSION hstore;'" 
(db_name 为数据库名称)

然后再 rake db:migrate

若出现其他extension(pg_trgm)
直接将"hstore"改为"pg_trgm"即可。

转载自:https://blog.csdn.net/hxker/article/details/50342301

You may also like...

退出移动版