Define PostgreSQL Table Properties

Use the PostgreSQL Table Editor to define table properties. This procedure assumes you are working in a physical model, with PostgreSQL defined as the target server.

To define properties for a PostgreSQL table:

  1. On the Model menu, click Tables .

    The PostgreSQL Table Editor opens.

  2. In the navigation grid, select the table that you want to define and work with the following options:

    Click New New icon in property editors to create a new object on the toolbar to create a new table. Use the Enter filter text box to filter a very large list of tables to quickly locate the one that you want to define.

    Physical Name

    Specifies the physical name of the table. Change the physical name of the table in this field.

    Physical Only

    Specifies whether the table is suppressed from a logical model and appears in a physical model only.

    Generate

    Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.

  3. Click the PostgreSQL tab and work with the following options:
    Temporary Type

    Specifies whether the table is created as a temporary table. Temporary tables are automatically dropped at the end of a session, or optionally at the end of the current transaction.

    Has OID

    Specifies whether the rows of the new table should have OIDs assigned to them.

    Unlogged

    Specifies whether the table should be created as an unlogged table. Data written to unlogged tables is not written to the write-ahead log, which makes them faster than ordinary tables.

    Commit Type

    Specifies the behavior of temporary tables at the end of a transaction block.

    PRESERVE ROWS

    No action is taken at the ends of transactions. This is the default behavior.

    DELETE ROWS

    All rows in the temporary table will be deleted at the end of each transaction block. An automatic TRUNCATE is done at each commit.

    DROP

    The temporary table will be dropped at the end of the current transaction block.

    Schema

    Specifies the schema of the database to which the table belongs. Select the schema from the drop-down list or click New New icon in property editors to create a new object to create one.

    Owner

    Specifies the role or user that owns the schema. Select the owner from the drop-down list or click New New icon in property editors to create a new object to create one.

    Like Table

    Specifies a table from which the new table automatically copies all column names, their data types, and their not-null constraints.

    Like Options

    Specifies the table column attributes to be copied. Select the required attribute from the drop-down list. You can either select all the available attributes or one of them at a time.

    Inherit From Tables

    Specifies a tables from which the new table automatically inherits all columns. Parent tables can be plain tables or foreign tables. A persistent relationship is created between the new child table and its parent table.

    Of Type

    Creates a typed table, which takes its structure from the specified composite type (name optionally schema-qualified). A typed table is tied to its type. For example, the table will be dropped if the type is dropped. Select an existing type from the drop-down list or click New New icon in property editors to create a new object to create one.

    Tablespace

    Specifies the tablespace in which the new table is to be created. If not specified, default tablespace is consulted, or temp tablespaces if the table is temporary. Select an existing tablespace from the drop-down list or click New New icon in property editors to create a new object to create one.

    Storage Parameters

    Specifies the storage parameters for tables, and for indexes associated with a UNIQUE, PRIMARY KEY, or EXCLUDE constraint.

    Like Table

    Specifies a table from which the new table automatically copies all column names, their data types, and their not-null constraints.

    With Default Values

    Specifies that the default values should be copied from the table specified under Like Table.

    With Constraints

    Specifies that the constraints should be copied from the table specified under Like Table.

    With Indexes

    Specifies that the indexes should be copied from the table specified under Like Table.

    With Storage

    Specifies that the storage options should be copied from the table specified under Like Table.

    With Comments

    Specifies that the comments should be copied from the table specified under Like Table.

  4. Click the Volumetrics tab and work with the following options:
    Initial Row Count

    Defines row count for the table. Enter a value in the field.

    Max Rows

    Defines row sizing for the table. Enter a value in the field.

    Growth By Month

    Defines growth increments for the table. Enter a value in the field.

  5. Work with the other tabs in the editor to access additional design features, for example:
    • Specify validation rules in the Validation tab.
    • Preview the forward engineering script for a table in the SQL tab.
    • Work with style sheets to format the font used in the display of the table in the Styletab.
    • Specify the icon style to use for the table in the Icon tab.
    • Specify the order of DDL generation in the Object Creation Order tab.
  6. (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
  7. (Optional) Click the Where Used tab to view where the object is used within the model.
  8. (Optional) Click the UDP tab to work with user-defined properties for the object.
  9. (Optional) Click the History tab to view the history information for the object.
  10. (Optional) Click the Notes tab to view and edit user notes.
  11. Click Close.

    The table is defined and the PostgreSQL Table Editor closes.

For more information on table properties, refer to PostgreSQL documentation.