当前位置:Gxlcms > 数据库问题 > Postgresql数据库安装中文全文搜索插件zhparser的问题

Postgresql数据库安装中文全文搜索插件zhparser的问题

时间:2021-07-01 10:21:17 帮助过:9人阅读

在PG数据库的基础上加装zhparser中文全文搜索插件,说实话,挺怕这些单独编译安装的插件的,因为安装PG数据库方法的不同,最后可能导致安装的插件各种安装不上,这里说一下我遇到的坑,系统环境是Centos7, yum安装的PG9.6。

1、INSTALL

关于安装方法,可以直接到上面看https://github.com/amutu/zhparser

2、make的时候缺少pgxs.mk

  1. <code>[root@az zhparser]# PG_CONFIG=/usr/pgsql-9.6/bin/pg_config make && make install
  2. Makefile:19: /usr/pgsql-9.6/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
  3. make: *** No rule to make target `/usr/pgsql-9.6/lib/pgxs/src/makefiles/pgxs.mk'. Stop.</code>

解决方法:

  1. <code>[root@az zhparser]# export PATH=/usr/pgsql-9.6/bin:$PATH
  2. [root@az zhparser]# yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
  3. [root@az zhparser]# yum install postgresql96-devel.x86_64</code>

3、创建zhparser的时候提示Permission denied

  1. <code>ERROR: could not open file "/usr/pgsql-9.6/share/tsearch_data/qc_dict_jupiter.txt" for writing: Permission denied
  2. HINT: COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
  3. CONTEXT: SQL statement "copy (select word, tf, idf, attr from zhparser.zhprs_custom_word) to '/usr/pgsql-9.6/share/tsearch_data/qc_dict_jupiter.txt' encoding 'utf8'"
  4. PL/pgSQL function sync_zhprs_custom_word() line 11 at EXECUTE</code>

解决方法:

  1. <code>chown -R postgres:postgres /usr/pgsql-9.6/share/tsearch_data/</code>

4、ERROR: ?must be superuser to alter superusers

  1. <code>[root@az data]# sudo -u postgres /usr/pgsql-9.6/bin/postgres --single -D /var/lib/pgsql/9.6/data/
  2. PostgreSQL stand-alone backend 9.6
  3. backend> ALTER USER postgres WITH SUPERUSER;
  4. backend></code>

Postgresql数据库安装中文全文搜索插件zhparser的问题

标签:cti   class   use   RoCE   sql数据库   单独编译   server   miss   关于   

人气教程排行