Defining PostgreSQL Views

The following properties are applicable to a PostgreSQL View object.

Tab

Section

Property

Description

Additional Information

    Name Specifies the name of the view  
    Schema Specifies the schema options for the schema generation Select the schema from the drop-down list or click New icon in property editors to create a new object to create a new object
    Use Replace Syntax Specifies whether the REPLACE syntax is used Selecting this option replaces the syntax with the new DDL that is generated during Forward Engineering
    Generate Specifies whether a SQL statement for the views are generated during forward engineering  
General

 

View Options Temporary Indicates that the view is created as a temporary view. Temporary views are automatically dropped at the end of the current session. If any tables referenced by the view are temporary, the view is created as temporary  
Recursive Indicates that the view is recursive  
Security Barrier Indicates that the view provides row-level security  

Security Invoker

Indicates that this option causes the underlying base relations to be checked against the privileges of the user of the view rather than the view owner

 

Select

 

Available Tables and Views

Specifies a list of available tables and views

Under Available Tables and Views, select the columns you want to define as view column 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 rows.

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.

 

Restriction Type

Specifies the type of restriction

With Check Option: Indicates that all modifications made through the view to the underlying tables satisfy the definition of the view.

With Cascaded Check: Indicates that all underlying views undergo the check testing.

With Local Check Option: Indicates that the check testing is restricted only to the views defined with this option.

 

Alias

Specifies an alternate name for the selected table or view

 

 

Expression

Specifies the expression for a selected column

 

 

New

Enables you to add a view column

 

 

Delete

Enables you to delete a view column

 

From

 

 

 

Available Tables and Views

Specifies a list of available tables and views

Under Available Tables and Views, select the tables or views from which you want to select view columns and then, click .

 

From

Specifies the selected tables and views

 

 

Alias

Specifies an alternate name for the selected table or view

This option is available only when you select a table or view in the From list. An alias is typically a new name that is more appropriate in the context of the view.

Where

 

 

 

 

 

 

Where

Specifies the boolean expression of the Where clause

 

 

Group By

Specifies the grouping expression that defines how the rows are grouped together

 

 

Having

Specifies the boolean expression of the Having clause

 

 

Order

Specifies the expression of the Order By clause

 

 

Restriction

Specifies the With Check Option for the view column.

With Check Option: Indicates that all modifications made through the view to the underlying tables satisfy the definition of the view.

With Cascaded Check Option: Indicates that all underlying views undergo the check testing.

With Local Check Option: Indicates that the check testing is restricted only to the views being defined.

Additional Properties

 

 

 

 

 

Select 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 along with its name. You can also 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

 

User Defined SQL

 

User-Defined SQL

Specifies whether the SQL code used in Forward Engineering is defined using the User Defined SQL tab

You can use the toolbar options to cut, copy, or paste text, open the Macro Toolbox, or work with the Text Editor.

  1. Work with the other tabs in the editor to access additional design features, for example: 
    • 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.
    • Define function permissions using the Permission tab.
  2. (Optional) Click the Comment tab and enter any comments 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 view is defined and the PostgreSQL View Editor closes.

For more information, refer to PostgreSQL documentation.