umitanuki / twitter_fdw

74 stars 11 forks source link

Does not compile against Postgres 9.5 #7

Closed bw-matthew closed 8 years ago

bw-matthew commented 8 years ago

https://github.com/bw-matthew/twitter_fdw/tree/postgres-9.5-issue

This branch includes a dockerfile which demonstrates the problem. You can build that by installing docker and running docker build . in the root of the project.

The root cause is this line (twitter_fdw.c line 433):

return make_foreignscan(tlist, keep_clauses, baserel->relid, NIL, baserel->fdw_private);

The signature of this changes in 9.5 to add a new argument (/usr/include/postgresql/9.5/server/optimizer/planmain.h):

extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
                 Index scanrelid, List *fdw_exprs, List *fdw_private,
                 List *fdw_scan_tlist);

If I just add a NULL value for that argument then the library compiles but I am not sure what the implications of that are.

bw-matthew commented 8 years ago

After including the NULL argument I can build the extension, connect to the postgres in the container and use the extension. However it returns no results for any query.

I have just tried the unmodified code against 9.4 and again no results are returned. There are no errors in the postgres log either.

bw-matthew commented 8 years ago

The search API used by the wrapper appears to be deprecated. When I go to http://search.twitter.com/search.json I see the message:

{"errors":[{"message":"The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.","code":64}]}

Reviewing the linked documentation I can see that the corresponding request endpoint is now:

https://dev.twitter.com/rest/reference/get/search/tweets

However this requires authentication and I am not easily able to find a request that does not require authentication. Since migrating to the new endpoint and adding support for authentication is unlikely to ever happen I am closing this bug.