Skip to content


Subversion checkout URL

You can clone with
Download ZIP
fdw extension for postgres
C Shell PLpgSQL Makefile
Branch: master
Failed to load latest commit information.
libjson-0.8 init commit
patches rename patch
sql -added support for cookie via CURLOPT_COOKIE
src support for PostgreSQL 9.5
test fix grammar error
Makefile remove duplicate for sql file 9.5 version mention in README
www_fdw.control new version compatible for 9.3


This library contains a PostgreSQL extension, a Foreign Data Wrapper (FDW) handler of PostgreSQL which provides easy way for interacting with different web-services.


$ export USE_PGXS=1
$ make && make install
$ psql -c "CREATE EXTENSION www_fdw" db

After that you need to create server for extension. The simpliest example here is:

$ cat test/default-json.sql
CREATE SERVER www_fdw_server_test FOREIGN DATA WRAPPER www_fdw OPTIONS (uri 'http://localhost:7777');
CREATE USER MAPPING FOR current_user SERVER www_fdw_server_test;
    title text,
    link text,
    snippet text
) SERVER www_fdw_server_test;

For more examples check github wiki.

postgresql versions


For XML support you need to install postgresql server with --with-libxml configure option and (check libxml dependency below).


For json support in your callbacks you need to install json type for postgresql.

This type is used only for custom callback functions only. Even though, you can parse text representations of json in this case.

Current implementation of postgresql json native type doesn't allow to retrieve fields, thus can't be used in current state.


Up-to-date documentation can be found at github.

PostgreSQL server installation

If your response isn't of xml type or you don't plan to use xml parsing in response_deserialize_callback - don't bother about it. Otherwise, in order to work with xml type (used in response_deserialize_callback) your installation has to support xml type. Usually it means building PostgreSQL with --with-libxml option. If you plan to use response_deserialize_callback for xml but with own parsing mechanism - your callback will be passed with text parameter.


This module depends on

The source of libjson is included in this module package and linked as a static library, whereas libcurl is assumed to be installed in the system. You may need additional development packages, as libcurl-dev. Consult your system and repository owner for more details.



Alex Sudakov

Copyright and License

This module is free software; you can redistribute it and/or modify it under the PostgreSQL License.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

In no event shall author(s) be liable to any party for direct, indirect, special, incidental, or consequential damages, including lost profits, arising out of the use of this software and its documentation, even if author(s) has been advised of the possibility of such damage.

Author(s) specifically disclaims any warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The software provided hereunder is on an "as is" basis, and author(s) has no obligations to provide maintenance, support, updates, enhancements, or modifications.

Something went wrong with that request. Please try again.