cyga / www_fdw

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

ERROR: cannot insert into foreign table "www_fdw_test_search" #27

Closed lifubang closed 8 years ago

lifubang commented 8 years ago

When I insert a row to a www foreign table, it said ERROR: cannot insert into foreign table "www_fdw_test_search". and the webservice cann't receive any data.

WHEN select, the web service server's console log window:

root@iZ250hk0d9wZ:/opt/www# node app
listening on port 1337
  <-- GET /fdw/?q=test&link=test1
## Hello World
  --> GET /fdw/?q=test&link=test1 404 10ms -

WHEN insert: there are nothing in server's console log window. How to deal with this problem. thx.

DROP SERVER www_fdw_test_server CASCADE;
CREATE SERVER www_fdw_test_server FOREIGN DATA WRAPPER www_fdw 
    OPTIONS (uri 'http://101.201.77.171:1337/view/fdw/',
    uri_select 'http://101.201.77.171:1337/fdw/',
    uri_insert 'http://101.201.77.171:1337/fdw/',
    uri_delete 'http://101.201.77.171:1337/fdw/',
    uri_update 'http://101.201.77.171:1337/fdw/'
    );

CREATE USER MAPPING FOR postgres SERVER www_fdw_test_server;

CREATE FOREIGN TABLE www_fdw_test_search (
  title text,
  link text,
  snippet text,
  q text 
) SERVER www_fdw_test_server;

SELECT * FROM www_fdw_test_search WHERE q='test' AND link='test1';

INSERT INTO www_fdw_test_search VALUES('title', 'link', 'snippet', 'qqq');
cyga commented 8 years ago

https://github.com/cyga/www_fdw/wiki/Documentation:

In the current version (postgres 9.1) there is no implementation for FDW INSERT/DELETE/UPDATE. But stuff related for INSERT/DELETE/UPDATE is reserved for future.