Closed dadhi closed 2 years ago
I'm also hitting this issue in postgres 12. Interestingly, it appears to be an issue when converting from json
implicitly or explicitly to any other type (jsonb
,text
, etc)
Thank you @dadhi and @mjrussell for reporting an issue.
We are able to reproduce the issue and this looks like a bug.
This issue comes when casting of target list has been performed by an user. After doing some initial investigation, came to know that mongo_fdw code missed to deparse a RelabelType (binary-compatible cast) node and considering this as an Var node which is wrong. So the handling of relabel type node need to be done.
We are internally tracking this and will try to address this issue.
@dadhi I had observed a similar bug when using mongo fdw <= 5.2.7 on postgres >= 10.0, seems this bug is fixed with release 5.2.8 of mongo fdw. Can you confirm release 5.2.8 does indeed fix this issue for you?
@sheim-dev I am no longer using mongo_fdw at the current project, so I won't be able to confirm. But the bug is easy reproducible, so I don't see a problem to check by the person who's using it.
@dadhi, @sheim-dev We have fixed this issue in release 5.2.8. Can you please let us know that this issue got resolved for you? If yes then will be closing this ticket.
@vaibhavdalvi93 I can confirm release 5.2.8 does indeed fix the issues I had observed with queries incorrectly returning NULL on PostgreSQL versions >= 10 just like in this bug report. From my perspective the issue can be closed, I'm also confident @dadhi original problem reported is fixed by release 5.2.8. Given he cannot provide independent explicit confirmation of that anymore, I think the issue should be closed.
Closing per @sheim-dev comment above.
Using the release https://github.com/EnterpriseDB/mongo_fdw/releases/tag/REL-5_2_5 and
PostgreSQL 12.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit
This does not work
But if the same field listed twice - it works
It is not working though if you put it twice as a function argument