EnterpriseDB / mongo_fdw

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

Could not compile mongo_fdw in 9.5.3 and 9.5.4 #66

Closed collectionneurfou closed 7 years ago

collectionneurfou commented 8 years ago

Hello,

I successfully manage to install (and use) latest MONGO_FDW extension for postgreSQL 9.4.8 (just downloaded as TAR file). I successfully install prereqs (BSON, LIBSON, MONGOC, etc..).

However i cannot get it to work in 9.5.3 and 9.5.4 (same error). It fails with this error :


postgres@dal-i-dbpg02 $ make clean

rm -f mongo_fdw.so   libmongo_fdw.a  libmongo_fdw.pc

rm -f connection.o option.o  mongo_wrapper.o mongo_fdw.o mongo_query.o mongo-c-driver/src/bson.os mongo-c-driver/src/encoding.os mongo-c-driver/src/md5.os mongo-c-driver/src/mongo.os mongo-c-driver/src/numbers.os mongo-c-driver/src/env.os json-c/json_util.o json-c/json_object.o json-c/json_tokener.o json-c/json_object_iterator.o json-c/printbuf.o json-c/linkhash.o json-c/arraylist.o json-c/random_seed.o json-c/debug.o

rm -rf results/ regression.diffs regression.out tmp_check/ log/

[ ~/mongo_fdw/mongo_fdw-REL-4_0_0 ]

postgres@dal-i-dbpg02 $ make -f Makefile.meta

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic --std=c99 -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0   -Ijson-c -DMETA_DRIVER -I. -I./ -I/logiciel/postgres/postgres-9.5.4/include/postgresql/server -I/logiciel/postgres/postgres-9.5.4/include/postgresql/internal -D_GNU_SOURCE  -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c -o connection.o connection.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic --std=c99 -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0   -Ijson-c -DMETA_DRIVER -I. -I./ -I/logiciel/postgres/postgres-9.5.4/include/postgresql/server -I/logiciel/postgres/postgres-9.5.4/include/postgresql/internal -D_GNU_SOURCE  -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c -o option.o option.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic --std=c99 -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0   -Ijson-c -DMETA_DRIVER -I. -I./ -I/logiciel/postgres/postgres-9.5.4/include/postgresql/server -I/logiciel/postgres/postgres-9.5.4/include/postgresql/internal -D_GNU_SOURCE  -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c -o mongo_fdw.o mongo_fdw.c

mongo_fdw.c: In function 'mongo_fdw_handler':

mongo_fdw.c:184: warning: assignment from incompatible pointer type

mongo_fdw.c: In function 'MongoGetForeignPaths':

mongo_fdw.c:322: warning: passing argument 8 of 'create_foreignscan_path' from incompatible pointer type

/logiciel/postgres/postgres-9.5.4/include/postgresql/server/optimizer/pathnode.h:82: note: expected 'struct Path *' but argument is of type 'struct List *'

mongo_fdw.c:322: error: too few arguments to function 'create_foreignscan_path'

mongo_fdw.c: In function 'MongoGetForeignPlan':

mongo_fdw.c:376: error: too few arguments to function 'make_foreignscan'

mongo_fdw.c: In function 'MongoPlanForeignModify':

mongo_fdw.c:635: error: 'RangeTblEntry' has no member named 'modifiedCols'

make: *** [mongo_fdw.o] Error 1

I'm stuck with this issue for days. I check in the git and seen that a similar error was "fixed" in the early beginning of the 9.5 (an error on number of args i think). I really need support for this for a POC regarding MONGO and PostgreSQL (9.4.8 is working but we need to demonstrate that it works in 9.5).

Regards,

Virgile

ahsanhadi commented 7 years ago

Mongodb FDW should work with 9.5 and 9.6. Can you please try building latest code. Please do a clean build in order to make sure that you are using the latest drivers.

ahsanhadi commented 7 years ago

Please close this issue if you have verified that mongodb_fdw works with 9.5 and 9.6?