Hi,
mongo_fdw advises to use "(__doc json)" where the exact structure of the collection's documents is unknown and/or dynamic.
And it's even working great for SELECT, DELETE and even UPDATE.
But then, when trying to INSERT a new row, the following error message is thrown:
ERROR: first column of MongoDB's foreign table must be "_id"
Of course, it's impossible to insert _id before __doc, because the "column relation does not exist".
Defining the columns as (_id name, __doc json) doesn't help either, because _id should be the first column of __doc, inside __doc
(otherwise, if there are more than one column, the command will fail because there are more values than columns).
Do I miss anything?
Or is it really impossible to INSERT rows into a (__doc json) foreign table?
Thanks!
Hi,
mongo_fdw advises to use "(__doc json)" where the exact structure of the collection's documents is unknown and/or dynamic.
And it's even working great for SELECT, DELETE and even UPDATE.
But then, when trying to INSERT a new row, the following error message is thrown:
ERROR: first column of MongoDB's foreign table must be "_id"
Of course, it's impossible to insert _id before __doc, because the "column relation does not exist".
Defining the columns as (_id name, __doc json) doesn't help either, because _id should be the first column of __doc, inside __doc
(otherwise, if there are more than one column, the command will fail because there are more values than columns).
Do I miss anything?
Or is it really impossible to INSERT rows into a (__doc json) foreign table?
Thanks!