YMatrix
Quick Start
Cluster Deployment
Data Model
Data Writing
Data Query
SQL Reference
Maintenance and Monitoring
Tool Guide
Troubleshooting
FAQ
Define a new external server.
CREATE SERVER server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
FOREIGN DATA WRAPPER fdw_name
[ OPTIONS ( [ mpp_execute { 'master' | 'any' | 'all segments' } [, ] ] option 'value' [, ... ] ) ]
CREATE SERVER Defines a new external server. The user who defines the server will become its owner.
External servers usually encapsulate external data wrappers to access connection information from external data sources. Other user-specific connection information can be specified through user mapping.
Creating a server requires USAGE privileges to the specified external data wrapper.
server_name
server_type
server_version
fdw_name
OPTIONS ( option 'value' [, ... ] )
mpp_execute { 'master' | 'any' | 'all segments' }
When using the dblink module (see dblink), the external server name can be used as a parameter to the dblink_connect() function to provide connection parameters. You must have USAGE privileges on an external server to use it this way.
Create an external server called myserver that uses an external data wrapper named pgsql and contains connection options:
CREATE SERVER myserver FOREIGN DATA WRAPPER pgsql
OPTIONS (host 'foo', dbname 'foodb', port '5432');
CREATE SERVER complies with ISO/IEC 9075-9 (SQL/MED).