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.
You must be a superuser to create a foreign data wrapper.
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.
Use the fields in the General tab to identify the foreign data wrapper:
Click the Definition tab to continue.
Use the fields in the Definition tab to set parameters:
Click the Options tab to continue.
Use the fields in the Options tab to specify options:
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.
Click the Security tab to continue.
Use the Security tab to assign security privileges. Click the Add icon (+) to assign a set of privileges.
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.
Click the SQL tab to continue.
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.
The following is an example of the sql command generated by user selections in the Foreign Data Wrapper dialog:
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.