【问题标题】:After compiling Postgresql 12 hstore extension was not found编译 Postgresql 后 12 hstore 扩展未找到
【发布时间】:2020-05-24 01:38:05
【问题描述】:

我已经用以下代码编译了 PostgreSQL 12。

curl --progress-bar https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2 | tar xj -C /usr/local/src/

cd src/postgresql-12.2
    ./configure --prefix=/usr/local --with-pgport=5432 --with-python --with-openssl --with-libxml --with-libxslt --with-zlib --with-llvm
    make -j "$(nproc)"
    make install
    make all
    make install
cd ../..
ldconfig

之后我尝试创建hstore 扩展。但它返回以下错误

错误:无法打开扩展控制文件 “/usr/local/share/postgresql/extension/hstore.control”:没有这样的文件 或目录

我怎样才能为我的编译获得该扩展工作。 注:我不想用apt-getyum,我要编译。

【问题讨论】:

    标签: postgresql hstore


    【解决方案1】:

    一些扩展随源代码分发在postgres/contrib 目录中,但默认情况下既不构建也不安装:您需要进入postgres/contrib/hstore 目录并运行通常的步骤:

    make
    make install
    

    并且可以运行(无需重启PG实例):

    # create extension hstore;
    CREATE EXTENSION
    

    并做一个快速检查:

    # select hstore(ROW(1,2));
            hstore        
    ----------------------
     "f1"=>"1", "f2"=>"2"
    (1 row)
    

    【讨论】:

    • 那么我需要在./configure之前做cd src/postgresql-12.2/contrib/hstore吗?
    • 不,我认为不需要。为所有 PG 源代码运行 ./configure 后,在同一源代码树中编译扩展时将重用这些设置。
    • 那么,我无法理解您的回答。在使用我给定的代码编译 postgres 之后,我是否需要再次从 postgres/contrib/hstore 发送 makemake install
    • 是的,这就是我刚刚对 PG 12.2 所做的。源代码,然后我运行没有错误create extension hstore;.
    猜你喜欢
    • 1970-01-01
    • 2021-03-16
    • 2015-09-14
    • 2022-10-07
    • 2017-01-05
    • 1970-01-01
    • 1970-01-01
    • 2018-03-02
    • 1970-01-01
    相关资源
    最近更新 更多