EnterpriseDB / mongo_fdw

PostgreSQL foreign data wrapper for MongoDB
GNU Lesser General Public License v3.0
330 stars 70 forks source link

autogen.sh runs OK but no /usr/share/postgresql/14/extension/mongo_ldw.control #182

Closed SaeedAILAR closed 8 months ago

SaeedAILAR commented 8 months ago

I followed the following steps on Ubuntu 22.04:

Pre-Requisites


sudo apt install cmake
sudo apt install postgresql-server-dev-14
sudo apt install pkgconf
sudo apt install build-essential

Download And Stage


cd /opt

mkdir mongo_ldw
cd mongo_ldw/

wget https://github.com/mongodb/mongo-c-driver/releases/download/1.17.3/mongo-c-driver-1.17.3.tar.gz
tar xzf mongo-c-driver-1.17.3.tar 
mv mongo-c-driver-1.17.3 mongo-c

wget https://github.com/json-c/json-c/archive/json-c-0.15-20200726.tar.gz
tar xzf json-c-0.15-20200726.tar.gz 
mv json-c-json-c-0.15-20200726/ json-c

wget https://github.com/EnterpriseDB/mongo_fdw/archive/refs/heads/master.zip

Build MONGO_LDW


unzip master.zip 
cd mongo_fdw-master/
./autogen.sh 

The output from autogen.sh is lengthy, and included warning messages, but got to the end without error like so:

[ 95%] Built target test_visit
[ 96%] Building C object tests/CMakeFiles/test_object_iterator.dir/test_object_iterator.c.o
[ 97%] Linking C executable test_object_iterator
[ 97%] Built target test_object_iterator
[ 98%] Building C object apps/CMakeFiles/json_parse.dir/json_parse.c.o
[100%] Linking C executable json_parse
[100%] Built target json_parse
Install the project...
-- Install configuration: "debug"
-- Installing: /lib/libjson-c.so.5.1.0
-- Installing: /lib/libjson-c.so.5
-- Installing: /lib/libjson-c.so
-- Installing: /lib/libjson-c.a
-- Installing: /lib/cmake/json-c/json-c-targets.cmake
-- Installing: /lib/cmake/json-c/json-c-targets-debug.cmake
-- Installing: /lib/cmake/json-c/json-c-config.cmake
-- Installing: /lib/pkgconfig/json-c.pc
-- Installing: /include/json-c/json_config.h
-- Installing: /include/json-c/json.h
-- Installing: /include/json-c/arraylist.h
-- Installing: /include/json-c/debug.h
-- Installing: /include/json-c/json_c_version.h
-- Installing: /include/json-c/json_inttypes.h
-- Installing: /include/json-c/json_object.h
-- Installing: /include/json-c/json_object_iterator.h
-- Installing: /include/json-c/json_pointer.h
-- Installing: /include/json-c/json_tokener.h
-- Installing: /include/json-c/json_types.h
-- Installing: /include/json-c/json_util.h
-- Installing: /include/json-c/json_visit.h
-- Installing: /include/json-c/linkhash.h
-- Installing: /include/json-c/printbuf.h
Done

But I try to create the extension in psql I get:

postgres=# create extension mongo_ldw;
ERROR:  could not open extension control file "/usr/share/postgresql/14/extension/mongo_ldw.control": No such file or directory

I checked and the file does not exist.

Please help.

surajkharage19 commented 8 months ago

Hi,

I can see typo in your create extension command, it is mongo_fdw but you have written mongo_ldw.

Even though you have provided the correct name and still the issue is same, then you need to configure and install mongo_fdw extension sources using below command:

To build on POSIX-compliant systems you need to ensure the pg_config executable is in your path when you run make. This executable is typically in your PostgreSQL installation's bin directory. For example:

export PATH=/usr/local/pgsql/bin/:$PATH

make USE_PGXS=1

make USE_PGXS=1 install

Also please refer for more details. https://github.com/EnterpriseDB/mongo_fdw/blob/master/INSTALL.md

SaeedAILAR commented 8 months ago

Thank you. I thought autogen.sh did it all, and didn't realise those make commands needed to be run manually. I ran those and it worked. Thanks.

Yes, I have made a typo mistake in the name.

SaeedAILAR commented 8 months ago

close