2016-06-21 03:06:44 -05:00
|
|
|
.. _foreign_data_wrapper_dialog:
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2018-06-15 03:14:12 -05:00
|
|
|
************************************
|
|
|
|
`Foreign Data Wrapper Dialog`:index:
|
|
|
|
************************************
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Use the *Foreign Data Wrapper* dialog to create or modify a foreign data
|
|
|
|
wrapper. A foreign data wrapper is an adapter between a Postgres database and
|
|
|
|
data stored on another data source.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2016-05-24 07:47:35 -05:00
|
|
|
You must be a superuser to create a foreign data wrapper.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
The *Foreign Data Wrapper* dialog organizes the development of a foreign data
|
|
|
|
wrapper through the following dialog tabs: *General*, *Definition*, *Options*,
|
|
|
|
and *Security*. The *SQL* tab displays the SQL code generated by dialog
|
|
|
|
selections.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2016-05-20 15:39:21 -05:00
|
|
|
.. image:: images/foreign_data_wrapper_general.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign data wrapper dialog general tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2018-01-11 10:58:30 -06:00
|
|
|
Use the fields in the *General* tab to identify the foreign data wrapper:
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Use the *Name* field to add a descriptive name for the foreign data wrapper.
|
|
|
|
A foreign data wrapper name must be unique within the database. The name will
|
|
|
|
be displayed in the *pgAdmin* tree control.
|
|
|
|
* Use the drop-down listbox next to *Owner* to select the name of the role that
|
|
|
|
will own the foreign data wrapper.
|
2016-05-24 07:47:35 -05:00
|
|
|
* Store notes about the foreign data wrapper in the *Comment* field.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Click the *Definition* tab to continue.
|
|
|
|
|
2016-05-20 15:39:21 -05:00
|
|
|
.. image:: images/foreign_data_wrapper_definition.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign data wrapper dialog definition tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Use the fields in the *Definition* tab to set parameters:
|
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Select the name of the handler function from the drop-down listbox in the
|
|
|
|
*Handler* field. This is the name of an existing function that will be called
|
|
|
|
to retrieve the execution functions for foreign tables.
|
|
|
|
* Select the name of the validator function from the drop-down listbox in the
|
|
|
|
*Validator* field. This is the name of an existing function that will be
|
|
|
|
called to check the generic options given to the foreign data wrapper, as
|
|
|
|
well as options for foreign servers, user mappings and foreign tables using
|
|
|
|
the foreign data wrapper.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Click the *Options* tab to continue.
|
|
|
|
|
2016-05-20 15:39:21 -05:00
|
|
|
.. image:: images/foreign_data_wrapper_options.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign data wrapper dialog options tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Use the fields in the *Options* tab to specify options:
|
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Click the the *Add* icon (+) button to add an option/value pair for the
|
|
|
|
foreign data wrapper. Supported option/value pairs will be specific to the
|
|
|
|
selected foreign data wrapper.
|
|
|
|
* Specify the option name in the *Option* field and provide a corresponding
|
|
|
|
value in the *Value* field.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Click the *Add* icon (+) to specify each additional pair; to discard an option,
|
|
|
|
click the trash icon to the left of the row and confirm deletion in the *Delete
|
|
|
|
Row* popup.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Click the *Security* tab to continue.
|
|
|
|
|
2016-05-20 15:39:21 -05:00
|
|
|
.. image:: images/foreign_data_wrapper_security.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign data wrapper dialog security tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Use the *Security* tab to assign security privileges. Click the *Add* icon (+)
|
|
|
|
to assign a set of privileges.
|
2016-05-13 08:43:57 -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-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Click add to assign additional privileges; to discard a privilege, click the
|
|
|
|
trash icon to the left of the row and confirm deletion in the *Delete Row*
|
|
|
|
popup.
|
2016-05-13 08:43:57 -05:00
|
|
|
|
|
|
|
Click the *SQL* tab to continue.
|
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Your entries in the *Foreign Data Wrapper* 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-24 07:47:35 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
Example
|
|
|
|
*******
|
2016-05-24 07:47:35 -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 Data Wrapper* dialog:
|
2016-05-24 07:47:35 -05:00
|
|
|
|
2016-05-20 15:39:21 -05:00
|
|
|
.. image:: images/foreign_data_wrapper_sql.png
|
2018-01-11 10:58:30 -06:00
|
|
|
:alt: Foreign data wrapper dialog sql tab
|
2019-03-08 09:29:05 -06:00
|
|
|
:align: center
|
2016-05-13 08:43:57 -05:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
The example creates a foreign data wrapper named *libpq_debug* that uses
|
|
|
|
pre-existing validator and handler functions, *dblink_fdw_validator* and
|
|
|
|
*libpg_fdw_handler*. Selections on the *Options* tab set *debug* equal to
|
|
|
|
*true*. The foreign data wrapper is owned by *postgres*.
|
2018-01-11 10:58:30 -06:00
|
|
|
|
2019-03-08 09:29:05 -06:00
|
|
|
* Click the *Help* button (?) to access online help.
|
2016-05-13 08:43:57 -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.
|