4 CREATE SERVER — define a new foreign server
8 CREATE SERVER [ IF NOT EXISTS ] server_name [ TYPE 'server_type' ] [ VERSION 'se
10 FOREIGN DATA WRAPPER fdw_name
11 [ OPTIONS ( option 'value' [, ... ] ) ]
15 CREATE SERVER defines a new foreign server. The user who defines the
16 server becomes its owner.
18 A foreign server typically encapsulates connection information that a
19 foreign-data wrapper uses to access an external data resource.
20 Additional user-specific connection information may be specified by
21 means of user mappings.
23 The server name must be unique within the database.
25 Creating a server requires USAGE privilege on the foreign-data wrapper
31 Do not throw an error if a server with the same name already
32 exists. A notice is issued in this case. Note that there is no
33 guarantee that the existing server is anything like the one that
34 would have been created.
37 The name of the foreign server to be created.
40 Optional server type, potentially useful to foreign-data
44 Optional server version, potentially useful to foreign-data
48 The name of the foreign-data wrapper that manages the server.
50 OPTIONS ( option 'value' [, ... ] )
51 This clause specifies the options for the server. The options
52 typically define the connection details of the server, but the
53 actual names and values are dependent on the server's
58 When using the dblink module, a foreign server's name can be used as an
59 argument of the dblink_connect function to indicate the connection
60 parameters. It is necessary to have the USAGE privilege on the foreign
61 server to be able to use it in this way.
63 If the foreign server supports sort pushdown, it is necessary for it to
64 have the same sort ordering as the local server.
68 Create a server myserver that uses the foreign-data wrapper
70 CREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'foo', db
71 name 'foodb', port '5432');
73 See postgres_fdw for more details.
77 CREATE SERVER conforms to ISO/IEC 9075-9 (SQL/MED).
81 ALTER SERVER, DROP SERVER, CREATE FOREIGN DATA WRAPPER, CREATE FOREIGN
82 TABLE, CREATE USER MAPPING