9.3.2
Table Of Contents
- Using VMware vFabric Postgres
- Contents
- Preface
- VMware Customizations for PostgreSQL
- Installing vFabric Postgres
- vFabric Postgres Client Tools and Libraries
- Managing vFabric Postgres
- Migrate PostgreSQL Data from Earlier Versions Into vFabric Postgres 9.3
- Migrate PostgreSQL Data Into vFabric Postgres
- Restarting the vFabric Postgres Service
- Connection to a vFabric Postgres Database
- Accounts and Services
- Safeguarding Data
- About vFabric Postgres Replication
- Create a Replication User Account
- Create a Replica Server
- Promote a Replica Database to Primary Database
- Monitoring Replication Status
- Using Perl and Python Language Extensions
- Viewing Performance Statistics
- Troubleshooting Guidelines
- Using the Graphical User Interface
- Index
Procedure
1 In the left pane, click the Schemas arrow to expand it.
2 Click the arrow next to the schema to expand it.
3 Select Views in the left pane.
All views under the schema appear in the list in the middle pane.
4 Right-click a view and select Open.
The view appears in the left pane.
5 Click the View Data tab to examine the data associated with the view.
Create a Constraint
Constraints let you reduce data entry errors by verifying data before inserting the data into a table.
You can create constraints when you create a table, or you can add them later by entering SQL fragments.
Prerequisites
Connect to the vFabric Postgres GUI. See “Access the Graphical User Interface,” on page 39.
Procedure
1 Click a table to select it, and click the gear icon.
2 Select Create > Constraint.
3 Select a constraint to create.
Constraint Type Description
Check
Limits the values or value range that can be inserted in a column.
Unique
Ensures that a column or set of columns is unique.
Primary key
Uniquely identifies each row in a table. You can have only one primary
key per table.
Foreign key
Points to a primary key in another table.
4 Complete the dialog and click OK.
Example: Create a Check Constraint
A check constraint evaluates to a Boolean value. Use Check constraints to determine whether a value
entered for a column meets a specific truth-type requirement. For example, suppose that you create a
column that must be a positive integer, such as a product price. You can create a Check constraint to return
TRUE when the product price is greater than 0, and to return FALSE when the product price is less than 0. The
Check constraint ensures that if a user tries to enter a negative product price, the data entry operation fails
with a SQL error.
1 Click a table to select it.
2 Click the gear icon, and select Create > Constraint.
3 Select Check Constraint.
1 Type a name for the constraint, such as check_positive_price.
2 Enter the constraint in the Check text box.
3 (Optional) Enter a comment that describes the constraint.
4 Click OK.
Using VMware vFabric Postgres
44 VMware, Inc.