為編譯安裝的PG安裝擴展

這個標題似乎很繞口。我的意思是如果是如果安裝Postgres時,如果是自己下載源碼編譯安裝,而make時又沒有make world,就會導致的pg最終沒有類似pg_stat_statements的擴展功能。那么,這篇文章將會講述如何在編譯安裝后,為pg安裝擴展。

讓我們以 pg_stat_statements 為例,前提是我們希望人們沒有刪除當初用于編譯pg的目錄。

首先,看一下pg的源碼目錄,可以看到有一個名為 contrib的目錄。

$ ls
aclocal.m4  config  config.log  config.status  configure  configure.in  contrib  COPYRIGHT  doc  GNUmakefile  GNUmakefile.in  HISTORY  INSTALL  Makefile  README  src

在這個目錄中,我們可以看到擴展包:

$ cd contrib
$ ls

都在這里:

adminpack    btree_gist        dblink        fuzzystrmatch    intarray        Makefile        pgcrypto        pg_stat_statements  README  start-scripts  tsm_system_rows  xml2

auth_delay    chkpass            dict_int      hstore          isn            oid2name        pg_freespacemap  pgstattuple        seg      tablefunc      tsm_system_time

auto_explain  citext            dict_xsyn      hstore_plperl    lo              pageinspect    pg_prewarm      pg_trgm            sepgsql  tcn            unaccent

bloom        contrib-global.mk  earthdistance  hstore_plpython  ltree          passwordcheck  pgrowlocks      pg_visibility      spi      test_decoding  uuid-ossp

btree_gin    cube              file_fdw      intagg          ltree_plpython  pg_buffercache  pg_standby      postgres_fdw        sslinfo  tsearch2      vacuumlo

假設我們要安裝pg_stat_statements,步驟相當簡單,其他的擴展包也是類似的安裝方式:

$ cd pg_stat_statements
$ make
$ sudo make install

官方文檔在這里,一開始沒有寫明在哪里執(zhí)行make && make install 所以比較confusing。

https://www.postgresql.org/docs/9.4/static/contrib.html

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容