Gitlab:Restoring PostgreSQL database gitlabhq_production ... ERROR: must be owner of extension pg_trgm

Restoring PostgreSQL database gitlabhq_production ... ERROR: must be owner of extension pg_trgm
ERROR: must be owner of extension btree_gist
ERROR: must be owner of extension btree_gist
ERROR: must be owner of extension pg_trgm

  1. 修改postgresql相关配置
    修改端口监听地址,默认监控localhost,* 代表all
    vi /var/opt/gitlab/postgresql/data/postgresql.conf
    listen_addresses = '*'
    最底下添加两行
    vi /var/opt/gitlab/postgresql/data/pg_hba.conf
local   all         all                               trust
host    all         all                               127.0.0.1/32 trust
  1. 重启gitlab服务
    gitlab-ctl restart

  2. 修改gitlab账号为超级用户

su - gitlab-psql
$ /opt/gitlab/embedded/bin/psql -h 127.0.0.1 gitlabhq_production
gitlabhq_production=# ALTER USER gitlab WITH SUPERUSER;
gitlabhq_production=# ALTER ROLE
gitlabhq_production=# \q
$ exit
  1. 重新执行恢复语句后,正常。
posted @ 2024-01-09 10:03  李济宏(Amadeus)  阅读(436)  评论(0编辑  收藏  举报