linux 安裝postgres 全文檢索支援

2022-09-13 16:39:10 字數 856 閱讀 1521

宣告:

postgres -version 9.2.5

1. * 安裝過程中遇到問題總結:

1. 上記鏈結操作執行 [make use_pgxs=1] 命令出錯

執行:yum install postgres-devel-9.25-1.fc18.x86_64.rpm

2. 繼續執行上記命令報錯,

執行:yum install mecab-devel.x86-64

3. 切換postgres使用者,執行到這步psql-f/usr/share/postgresql/9.1/contrib/textsearch_ja.sql 時候,回車繼續出錯。

原因,開啟這個textsearch_ja.sql檔案,找到[language 'c' strict;] 將當前檔案中粗體部分單引號中的c全部改寫為小寫c。

4. 繼續執行,命令解釋。

a. create index idx ontestusing gin(to_tsvector('japanese',name));

解釋:test: 資料庫表名

japanese: 日文編碼

name: 資料庫表列名

b. select * from test where to_tsvector('japanese', name)@@ to_tsquery('japanese', web_query('小林'))

本番環境問題補充:

1. 日文分詞器(mecab)

2. 修改yum源。

Linux 下安裝postgres 安裝教程

用到的幾個rpm安裝檔案 1 postgresql libs 8.4.13 1.el6 3.x86 64.rpm 2 postgresql 8.4.13 1.el6 3.x86 64.rpm 3 postgresql server 8.4.13 1.el6 3.x86 64.rpm 4 uuid 1...

linux下postgres的安裝

解壓並安裝到制定的目錄 tar zxvf postgresql 10.7 1 linux x64 binaries.tar.gz c opt postgres現在postgres的安裝目錄就是 opt postgres pgsql 建立postgres使用者並設定密碼 useradd postgre...

centos下postgres的安裝

1.進行安裝 sudo yum install postgresql server postgresql contrib初始化 sudo postgresql setup initdb2.修改配置 sudo vim var lib pgsql data pg hba.conf配置檔案目錄可能帶版本號...