dwa / mongoose_fdw

Experimental Postgres fdw for MongoDB
MIT License
7 stars 5 forks source link

No result #1

Open rendybjunior opened 8 years ago

rendybjunior commented 8 years ago

I created server & foreign table as per below:

CREATE SERVER mongodb_proxy_server FOREIGN DATA WRAPPER multicorn OPTIONS (wrapper 'mongoose_fdw.Mongoose_fdw');
CREATE FOREIGN TABLE test ( "_id" varchar OPTIONS (type 'ObjectId'), a numeric, d varchar )
   SERVER mongodb_proxy_server OPTIONS ( db 'mongo-fdw', collection 'test', host 'localhost', port '27017', user 'mongo-fdw', password 'mongo-fdw' );

It is also there in postgres log

2016-06-08 09:31:04 WIB [13310-2] postgres@postgres STATEMENT:  CREATE create SERVER mongodb_proxy_server FOREIGN DATA WRAPPER multicorn OPTIONS (wrapper 'mongoose_fdw.Mongoose_fdw');
And here is describe table result
              Foreign table "public.test"
 Column |       Type        | Modifiers |    FDW Options    
--------+-------------------+-----------+-------------------
 _id    | character varying |           | (type 'ObjectId')
 a      | numeric           |           | 
 d      | character varying |           | 
Server: mongodb_proxy_server
FDW Options: ("user" 'mongo-fdw', password 'mongo-fdw')

But when I do simple select, nothing is coming

postgres-# select * from test
postgres-# 

Meanwhile the data is there

> use mongo-fdw
switched to db mongo-fdw
> db.test.find()
{ "_id" : ObjectId("57578255fc2e0738bc1e8e0f"), "a" : 1 }
> 

Does the latest code really work? Any idea what is wrong?

ghost commented 7 years ago

@rendybjunior I noticed, that you haven't close this query

postgres-# select * from test

with semicolon. is this a copy-paste omission or you really run a query without ; symbol?