简体   繁体   中英

PostgreSQL create extension mongo_fdw

I want to connect a PostgreSQL database with a MongoDB by using Mongo_fdw. After following this instruction to install mongo_fdw with the autogen.sh script on Ubuntu 22.04 LTS, I wanted to check the connection and ran CREATE EXTENSION mongo_fdw; in my database, but the following error occured:

ERROR: could not access file "$libdir/mongo_fdw": No such file or directory

Searchig for a solution I found this page on GitHub, where the same error is discussed. Following the recommendations there, I checked pg_config --version , pg_config --libdir and pg_config --sharedir with the following results:

$ pg_config --version
PostgreSQL 12.9
$ pg_config --libdir
/home/qgis/anaconda3/lib
$ pg_config --sharedir
/home/qgis/anaconda3/share

When I check /home/qgis/anaconda3/share/extension I get the following files:

drwxrwxr-x  2 qgis qgis 4096 Feb  1 10:58 ./
drwxrwxr-x 32 qgis qgis 4096 Jan 18 10:28 ../
-rw-r--r--  1 root root  157 Feb  1 10:58 mongo_fdw--1.0--1.1.sql
-rw-r--r--  1 root root  593 Feb  1 10:58 mongo_fdw--1.0.sql
-rw-r--r--  1 root root  709 Feb  1 10:58 mongo_fdw--1.1.sql
-rw-r--r--  1 root root  274 Feb  1 10:58 mongo_fdw.control
-rw-rw-r--  2 qgis qgis  310 Jun 24  2022 plpgsql--1.0.sql
-rw-rw-r--  2 qgis qgis  179 Jun 24  2022 plpgsql.control
-rw-rw-r--  2 qgis qgis  370 Jun 24  2022 plpgsql--unpackaged--1.0.sql

I also ran ldconfig as it is recommended on the GitHub page but with no results.

Does someone has an idea how to solve this error?

Thanks in advance!

You have to specify the correct pg_config when building the software, probably

make PG_CONFIG=/usr/lib/postgresql/14/bin/pg_config

That file should exist if you installed the package with the C headers, which is typically called "devel" or "dev" or similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM