Database Reference
In-Depth Information
LANGUAGE C STRICT;
CREATE FOREIGN DATA WRAPPER dummy_fdw
HANDLER dummy_fdw_handler
VALIDATOR dummy_fdw_validator;
The control ile to manage version and
module path
A module or extension control ile contains the wrapper version and module library
path as shown:
#dummy_fdw.control
comment = 'Foreign data wrapper for querying a dummy server'
default_version = '1.0'
module_pathname = '$libdir/dummy_fdw'
relocatable = true
Let's consider the various parameters mentioned in the preceding snippet:
comment : This gives the comments for the foreign data wrapper
default_version : This gives the version number of extension
Module_pathname : This gives the foreign data wrapper library path
Loading foreign data wrappers
Foreign data wrappers are extensions and can be loaded using CREATE EXTENSION .
We will discuss extensions in the next chapter in detail. The syntax for loading
foreign data wrappers is as follows:
CREATE EXTENION dummy_fdw;
Creating a server
After loading the extension, we need to create a foreign server that typically consists
of connection information. Normally, the connection information consists of a
remote machine hostname or IP address and target system port number. The user
information may be speciied in user mapping.
CREATE SERVER server_name
[ TYPE 'server_type' ] [ VERSION 'server_version' ]
FOREIGN DATA WRAPPER fdw_name
[ OPTIONS ( option 'value' [, ... ] ) ]
 
Search WWH ::




Custom Search