Defining PostgreSQL Materialized Views

The following properties are applicable to a PostgreSQL Materialized View object.

Tab

Section

Property

Description

Additional Properties

 

 

Name

Specifies the name of the materialized view

 

 

 

Schema

Specifies the schema for the materialized view. Select a schema from the drop-down list or click New icon in property editors to create a new object to create a new one.

 

 

 

If Not Exists

Specifies if the materialized view already exists, no exception is thrown, and no action happens

 

 

 

Generate

Specifies whether a SQL statement for the collation is generated during forward engineering

 

General

General Options

Access Method

Specifies the table access method to use to store the contents for the new materialized view

 

Storage Parameters

Specifies optional storage parameters for the new materialized view

 

Tablespace

Specifies the name of the tablespace in which the new materialized view is to be created

 

With Clause

Defines properties for the materialized view creation

With No Data: Specifies whether the query should copy the table structure into the new table

With Data: Specifies whether the query should copy the produced data into the new table

Select

 

Available Tables and Views

Specifies a list of available tables and views

Under the Available Tables and Views, select the columns you want to define as view columns, and then click .

 

Columns

Specifies the columns selected from the available tables and views

 

 

Select Type

Specifies the expression type to indicate whether duplicate rows are returned

All: Indicates that the statement returns all rows, including duplicate row

Distinct: Indicates that the statement discards duplicate rows and returns only the remaining rows

Unique: Indicates that the statement discards duplicate value stored in a column or column sets

Distinct Row: Indicates that the statement discards duplicate records and includes duplicate fields

 

Alias

Specifies a temporary name given to a table, column, or expression present in a query based on the selected column

 

 

Expression

Specifies the expression for a selected column

 

 

New

Enables you to add a view column

 

 

Delete

Enables you to delete a view column

 

Additional Properties

 

Limit

Limits the number of rows returned

 

 

Offset

Specifies the hours, minutes, and seconds difference from UTC, and the maximum difference between the current row's column value and its preceding or following row's value

 

 

Fetch

Retrieves rows from a query using a cursor

 

 

With Query

Hides any real table with the same name when used in the main query. To reference a real table with the same name, specify the table's schema and name. You can assign an alias to the WITH query, similar to a table.

 

 

Window

Specifies window function behavior in query's SELECT or ORDER BY clause, referencing WINDOW clause entries in OVER clauses. It saves typing for multiple window functions.

 

 

Locking Clause

Specifies how data should be locked during a transaction. It allows you to control concurrent access to data by explicitly acquiring locks on tables or rows

 

  1. Work with the other tabs in the editor to access additional design features, for example:
    • Select the tables and views that you want to participate in the view using the From tab.
    • Enter text to define a WHERE clause in the Clauses tab.
    • View and change a user-provided DDL statement in the User Defined SQL tab.
    • View the SQL code used during Forward Engineering using the SQL tab.
    • Work with style sheets, which are used to format the font and other graphical themes used in the display of the view in the Style tab.
    • Specify the icon style to use for the view in the Icon tab and to specify an image properties, refer to the Specify Image Properties topic.
  2. (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
  3. (Optional) Click the Where Used tab to view where the object is used within the model.
  4. (Optional) Click the UDP tab to work with user-defined properties for the object.
  5. (Optional) Click the History tab to view the history information for the object.
  6. (Optional) Click the Notes tab to view and edit user notes.
  7. (Optional) Click the Extended Notes tab to view or edit user notes.
  8. Click Close.

    The materialized view is defined, and the PostgreSQL Materialized View Editor closes.

For more information, refer to PostgreSQL documentation.