cyga / www_fdw

fdw extension for postgres
http://wiki.postgresql.org/wiki/WWW_FDW
123 stars 21 forks source link

incorrect json parsing? (duckduckgo) #16

Closed rhartdev closed 9 years ago

rhartdev commented 9 years ago

using the api: https://api.duckduckgo.com/api

When u visit: http://api.duckduckgo.com/?q=test&format=json u get data

When u use curl: curl --get 'http://api.duckduckgo.com/?q=test&format=json' u get data

When u use the fdw not? For example: CREATE SERVER www_fdw_server_duckduckgo FOREIGN DATA WRAPPER www_fdw OPTIONS (uri 'http://api.duckduckgo.com/', response_type 'json'); CREATE USER MAPPING FOR current_user SERVER www_fdw_server_duckduckgo; CREATE FOREIGN TABLE www_fdwduckduckgo3 ( /* parameters used in request / / format is (json or xml)/
q text, format text,
/_ fields in response */
"Heading" text ) SERVER www_fdw_server_duckduckgo;

but: select * from www_fdw_duckduckgo3 where q='test' and format='json'; will return no lines (0 lines, just the headers of the table). (and no errors)

debugging: set client_min_messages to debug5; did'nt improve

comparing with the wikimedia example, it doesnt seem to matter if all io columns are included, the same result with more columns (ie no output)

So the given query should return data (as a browser or curl do when accessing the api), but unfortunately no rows are returned.