{"action":"created","issue":{"url":"https://api.github.com/repos/pramsey/pgsql-http/issues/13","labels_url":"https://api.github.com/repos/pramsey/pgsql-http/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/pramsey/pgsql-http/issues/13/comments","events_url":"https://api.github.com/repos/pramsey/pgsql-http/issues/13/events","html_url":"https://github.com/pramsey/pgsql-http/issues/13","id":73942685,"number":13,"title":"ERROR:  cache lookup failed for type 0","user":{"login":"arakattack","id":12294296,"avatar_url":"https://avatars.githubusercontent.com/u/12294296?v=3","gravatar_id":"","url":"https://api.github.com/users/arakattack","html_url":"https://github.com/arakattack","followers_url":"https://api.github.com/users/arakattack/followers","following_url":"https://api.github.com/users/arakattack/following{/other_user}","gists_url":"https://api.github.com/users/arakattack/gists{/gist_id}","starred_url":"https://api.github.com/users/arakattack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arakattack/subscriptions","organizations_url":"https://api.github.com/users/arakattack/orgs","repos_url":"https://api.github.com/users/arakattack/repos","events_url":"https://api.github.com/users/arakattack/events{/privacy}","received_events_url":"https://api.github.com/users/arakattack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-07T11:04:02Z","updated_at":"2015-05-10T19:11:57Z","closed_at":null,"body":"Hi,\r\n\r\nThis is very cool idea but I got difficulties using this library.\r\nCompiling is no problem on CentOS 5.8 with pg 9.1.15\r\nBut create extension failed with various errors (not found module path, type column). Having successfully installed extension, I couldn't use it due to ERROR: cache lookup failed for type 0\r\nOnly urlencode() works.\r\n\r\nPlease advise.\r\nThank you\r\n\r\nPS: I edited sql with code below:\r\n\r\nCREATE DOMAIN http_method AS text\r\nCHECK (\r\n    VALUE ILIKE 'get' OR\r\n    VALUE ILIKE 'post' OR\r\n    VALUE ILIKE 'put' OR\r\n    VALUE ILIKE 'delete'\r\n);\r\n\r\nCREATE DOMAIN content_type AS text\r\nCHECK (\r\n    VALUE ~ '^\\S+\\/\\S+'\r\n);\r\n\r\nCREATE TYPE http_header AS (\r\n    field VARCHAR,\r\n    value VARCHAR\r\n);\r\n\r\nCREATE TYPE http_response AS (\r\n\tstatus INTEGER,\r\n\tcontent_type VARCHAR,\r\n\theaders http_header[],\r\n\tcontent VARCHAR\r\n);\r\n\r\nCREATE TYPE http_request AS (\r\n\tmethod http_method,\r\n    uri VARCHAR,\r\n\theaders http_header[],\r\n\tcontent_type VARCHAR,\r\n\tcontent VARCHAR\r\n);\r\n\r\nCREATE OR REPLACE FUNCTION http_header (field VARCHAR, value VARCHAR) \r\n    RETURNS http_header\r\n    AS $$ SELECT $1, $2 $$ \r\n    LANGUAGE 'sql';\r\n\r\nCREATE OR REPLACE FUNCTION http(request http_request)\r\n    RETURNS http_response\r\n    AS '$libdir/http', 'http_request'\r\n    LANGUAGE 'c';\r\n\r\nCREATE OR REPLACE FUNCTION http_get(uri VARCHAR)\r\n\tRETURNS http_response\r\n\tAS $$ SELECT http(('GET', $1, NULL, NULL, NULL)::http_request) $$\r\n    LANGUAGE 'sql';\r\n\r\nCREATE OR REPLACE FUNCTION http_post(uri VARCHAR, content VARCHAR, content_type VARCHAR)\r\n\tRETURNS http_response\r\n\tAS $$ SELECT http(('POST', $1, NULL, $3, $2)::http_request) $$\r\n    LANGUAGE 'sql';\r\n\r\nCREATE OR REPLACE FUNCTION http_put(uri VARCHAR, content VARCHAR, content_type VARCHAR)\r\n\tRETURNS http_response\r\n\tAS $$ SELECT http(('PUT', $1, NULL, $3, $2)::http_request) $$\r\n    LANGUAGE 'sql';\r\n\r\nCREATE OR REPLACE FUNCTION http_delete(uri VARCHAR)\r\n\tRETURNS http_response\r\n\tAS $$ SELECT http(('DELETE', $1, NULL, NULL, NULL)::http_request) $$\r\n    LANGUAGE 'sql';\r\n\r\nCREATE OR REPLACE FUNCTION urlencode(string VARCHAR)\r\n\tRETURNS TEXT\r\n\tAS '$libdir/http'\r\n\tLANGUAGE 'c'\r\n\tIMMUTABLE STRICT; "},"comment":{"url":"https://api.github.com/repos/pramsey/pgsql-http/issues/comments/100682350","html_url":"https://github.com/pramsey/pgsql-http/issues/13#issuecomment-100682350","issue_url":"https://api.github.com/repos/pramsey/pgsql-http/issues/13","id":100682350,"user":{"login":"pramsey","id":113883,"avatar_url":"https://avatars.githubusercontent.com/u/113883?v=3","gravatar_id":"","url":"https://api.github.com/users/pramsey","html_url":"https://github.com/pramsey","followers_url":"https://api.github.com/users/pramsey/followers","following_url":"https://api.github.com/users/pramsey/following{/other_user}","gists_url":"https://api.github.com/users/pramsey/gists{/gist_id}","starred_url":"https://api.github.com/users/pramsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pramsey/subscriptions","organizations_url":"https://api.github.com/users/pramsey/orgs","repos_url":"https://api.github.com/users/pramsey/repos","events_url":"https://api.github.com/users/pramsey/events{/privacy}","received_events_url":"https://api.github.com/users/pramsey/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T19:11:57Z","updated_at":"2015-05-10T19:11:57Z","body":"Can you tell me what you changed?"}}