Skip to main content
Version: 2.0.0 (latest)

3.20. Foreign tables

Foreign tables, like tables, are containers that store several kinds of other objects, like columns, constraints, and triggers. The substantial difference between tables and foreign tables is that the latter retrieve their data using a foreign server, which is attached to a foreign data wrapper. All child objects of a foreign table are configured in the same way as the table's child objects, so refer to their respective documentation pages for more details. The other attributes of the foreign table are detailed below:

ch3.foreigntable-dialog.general1234

General
#FieldGroup boxDescription
1ServerOptions

The foreign server the foreign table is retrieved from.

2TagOptions

This attribute is used to configure the tag object associated with the table. Tags are used to visually separate tables and views, even if they belong to the same schema. Details about tags can be seen further in this chapter in the section Tags.

3Generate ALTER for columns / constraintsOptions

When checked, all the columns and constraints are generated as ALTER TABLE commands. This was useful for incremental modeling, that is, creating objects in tables that already exist on a running PostgreSQL server. Since the diff tool is available, we recommend using the model/database comparison for incremental modeling instead of this option.

4Edit data

Define initial data for the table

ch3.foreigntable-dialog.columns1

Columns
#FieldDescription
1Columns

The columns of the object (primary key mark, name, type, default value, attributes, alias, and comment). Use the buttons beside the list to add , edit , duplicate , remove , and reorder them. Refer to the section Columns for the column form.

ch3.foreigntable-dialog.constraints1

Constraints
#FieldDescription
1Constraints

The constraints of the table (name, type, ON DELETE, ON UPDATE, alias, and comment). Use the buttons beside the list ( ) to handle them. Refer to the section Constraints for details.

ch3.foreigntable-dialog.triggers1

Triggers
#FieldDescription
1Triggers

The triggers of the object (name, referenced table, firing time, events, alias, and comment). Use the buttons beside the list ( ) to handle them. Refer to the section Triggers for details.

ch3.foreigntable-dialog.tables1

Tables
#FieldDescription
1Ancestor tables

The ancestors of the foreign table, that is, the tables linked to it through a generalization relationship. Refer to the section Relationships for details.

ch3.foreigntable-dialog.options1

Options
#FieldDescription
1Options

The options associated with the foreign table or one of its columns. The allowed option names and values are specific to each foreign data wrapper and are validated by its validator function.

References​

Foreign table DDL
https://www.postgresql.org/docs/current/sql-createforeigntable.html