2016-06-21 03:06:44 -05:00
|
|
|
.. _foreign_server_dialog:
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2018-06-15 03:14:12 -05:00
|
|
|
******************************
|
|
|
|
`Foreign Server Dialog`:index:
|
|
|
|
******************************
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Use the *Foreign Server* dialog to create a foreign server. A foreign server
|
|
|
|
typically encapsulates connection information that a foreign-data wrapper uses
|
|
|
|
to access an external data resource. Each foreign data wrapper may connect to a
|
|
|
|
different foreign server; in the *pgAdmin* tree control, expand the node of the
|
|
|
|
applicable foreign data wrapper to launch the *Foreign Server* dialog.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
The *Foreign Server* dialog organizes the development of a foreign server
|
|
|
|
through the following dialog tabs: *General*, *Definition*, *Options*, and
|
|
|
|
*Security*. The *SQL* tab displays the SQL code generated by dialog selections.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
.. image:: images/foreign_server_general.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign server dialog general tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
Use the fields in the *General* tab to identify the foreign server:
|
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Use the *Name* field to add a descriptive name for the foreign server. The
|
|
|
|
name will be displayed in the *pgAdmin* tree control. It must be unique within
|
|
|
|
the database.
|
2016-05-26 09:29:33 -05:00
|
|
|
* Use the drop-down listbox next to *Owner* to select a role.
|
|
|
|
* Store notes about the foreign server in the *Comment* field.
|
|
|
|
|
|
|
|
Click the *Definition* tab to continue.
|
|
|
|
|
|
|
|
.. image:: images/foreign_server_definition.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign server dialog definition tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
Use the fields in the *Definition* tab to set parameters:
|
|
|
|
|
|
|
|
* Use the *Type* field to specify a server type.
|
|
|
|
* Use the *Version* field to specify a server version.
|
|
|
|
|
|
|
|
Click the *Options* tab to continue.
|
|
|
|
|
|
|
|
.. image:: images/foreign_server_options.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign server dialog options tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Use the fields in the *Options* tab to specify options. Click the *Add* button
|
|
|
|
to create an option clause for the foreign server.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
* Specify the option name in the *Option* field.
|
2018-01-11 10:58:30 -06:00
|
|
|
* Provide a corresponding value in the *Value* field.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Click *Add* to create each additional clause; to discard an option, click the
|
|
|
|
trash icon to the left of the row and confirm deletion in the *Delete Row*
|
|
|
|
popup.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
Click the *Security* tab to continue.
|
|
|
|
|
|
|
|
.. image:: images/foreign_server_security.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign server dialog security tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Use the *Security* tab to assign security privileges to the foreign server.
|
|
|
|
Click *Add* before you assign a set of privileges.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
* Select the name of the role from the drop-down listbox in the *Grantee* field.
|
2019-03-08 09:29:05 -06:00
|
|
|
* Click inside the *Privileges* field. Check the boxes to the left of one or
|
|
|
|
more privileges to grant the selected privileges to the specified user.
|
2019-11-25 21:03:59 -06:00
|
|
|
* The current user, who is the default grantor for granting the privilege, is displayed in the *Grantor* field.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Click *Add* to assign a new set of privileges; to discard a privilege, click the
|
|
|
|
trash icon to the left of the row and confirm deletion in the *Delete Row*
|
|
|
|
dialog.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
|
|
|
Click the *SQL* tab to continue.
|
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Your entries in the *Foreign Server* dialog generate a SQL command (see an
|
|
|
|
example below). Use the *SQL* tab for review; revisit or switch tabs to make
|
|
|
|
any changes to the SQL command.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Example
|
|
|
|
*******
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
The following is an example of the sql command generated by user selections in
|
|
|
|
the *Foreign Server* dialog:
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2018-01-11 10:58:30 -06:00
|
|
|
.. image:: images/foreign_server_sql.png
|
|
|
|
:alt: Foreign server dialog sql tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
The example shown demonstrates creating a foreign server for the foreign data
|
|
|
|
wrapper *hdfs_fdw*. It has the name *hdfs_server*; its type is *hiveserver2*.
|
|
|
|
Options for the foreign server include a host and a port.
|
2016-05-26 09:29:33 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Click the *Info* button (i) to access online help.
|
2016-05-26 09:29:33 -05:00
|
|
|
* Click the *Save* button to save work.
|
|
|
|
* Click the *Cancel* button to exit without saving work.
|
|
|
|
* Click the *Reset* button to restore configuration parameters.
|