0
votes

I have compiled PostgreSQL 12 with the following code.

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

After that I am trying to create hstore extension. but it is returning the following error

ERROR: could not open extension control file "/usr/local/share/postgresql/extension/hstore.control": No such file or directory

How can I get that extension work for my compilation. N.B. I do not want to use apt-get or yum, I want to compile.

1

1 Answers

0
votes

Some extensions are distributed with the source code in postgres/contrib directory but are neither built nor installed by default: you need to go in postgres/contrib/hstore directory and to run the usual steps:

make
make install

And you can run (no need to restart PG instance):

# create extension hstore;
CREATE EXTENSION

And do a quick check:

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