• No results found

Error "Stored Routine Name Uniqueness"

Check diagram stored procedures and functions for the uniqueness of name within a schema.

Warning "Stored Routine Name Max Length"

PostgreSQL allows only 63 characters in stored routine names and cuts names if they are longer than this;

Views

Error "View Name Uniqueness"

Check diagram stored procedures and functions for the uniqueness of name within a schema.

than this;

Error "View was created on a not existing table"

Check existence of tables, which are used in the view;

Error "View was created on a not existing column"

Check existence of table columns, which are used in the view.

After you click OK the check process will be displayed within the Output window and the result of the check will be displayed within the Result window in the same categorized view as described above.

Double-click on a warning or an error in the list opens the editor window for the appropriate object (Table Editor, Index Editor, or Domain Manager).

See also:

Diagram Objects: Table Editor | Column Editor | Reference Editor | Index Editor

8.2. Merge Diagram

The Merge Diagram tool of the Database Designer for PostgreSQL allows you to merge content of two diagrams. This allows you to create new cumulative diagram, which will include content of your two diagrams.

To merge two diagrams, please follow these steps:

1. Open two diagrams you want to merge. One of them will accumulate its own content and content of other diagram.

2. Start Merge Diagram tool by selecting the Diagram | Merge Diagram menu item.

3. Select diagrams you want to merge. Make sure that you have chosen Options tab of the Merge Diagram tool.

From diagram

Choose the source diagram from drop-down menu, which contains list of opened diagrams. Objects of this diagram will be added to the destination diagram.

To diagram

Choose the destination diagram from the drop-down menu, which contains the list of the opened diagrams. This diagram will contain its own objects and objects of source diagram. Set the name of the database user who will own the new database, or type DEFAULT to use the default (namely, the user executing the command).

4. Select the source diagram objects to merge. Go to the Objects tab. Click on the appropriate checkboxes to select objects you want to add to the destination diagram. To select/deselect all objects of particular type, click on appropriate checkbox near them. There are the following objects types: Domains, Notes, Tables, References (by default all objects are already selected).

5. Click OK to add the selected objects of the source diagram to the destination diagram.

6. Save the resulted (destination) diagram to a new file.

8.3. Repair Diagram

The Repair Diagram tool of the Database Designer for PostgreSQL allows to check and repair underlying physical structure of model file (*.pdd) if some reference integrity was broken.

During file opening Database Designer automatically checks file for reference corruption, and if Repair needed Model Repairing dialog appears. You may Cancel this operation. However, it is strongly recommended to proceed. After Repairing you may use Save As dialog to leave a backup of old model file.

To open manually the Repair Diagram dialog select the Diagram | Repair Diagram menu item.

Check Color tables with duplicated IDs to distinguish entities with non unique identifiers.

Use the Fill Color drop-down list to select the desired color for such action.

Check Color references which are joined to tables with duplicated IDs to mark the references which can not be unambiguously related to single table.

Use the Fill Color drop-down list to select the desired color for such action.

9. Database Functions

Database Designer for PostgreSQL supports the following database related functions:

New Database Wizard, that allows you to create a new physical database;

Database Generation, that allows to generate SQL script, that represents the diagram you developed and executes it on the database server;

Database Modification, that allows to generate SQL script that leads your database to the current state of your diagram.

9.1. New Database Wizard

New Database Wizard allows you to create a new physical database. Later on you could generate its structure represented in the diagram by using Database Generation. New Database Wizard takes the preferences you set for database using Database Editor and guides your through steps where you tune server connection parameters and other options for the new database. As a result the wizard creates a physical database and a new connection profile for it.

To open the wizard select the Database | New Database Wizard menu item. The wizard can be

Let's explore the steps of the wizard.

1. The first step of the wizard prompts for the new database name. If you set the Check if database exists option on, then the new database will be created only if no database with such name exists on the server.

2. The next step of the wizard allows you to define the connection properties for connecting to the new database server. You should use user that have enough rights to create a new database on the server. The properties you tune on this step are:

Host

Sets the PostgreSQL server address.

Port

Sets the PostgreSQL server port.

User

Sets the PostgreSQL user login.

Password

Sets the PostgreSQL user password Timeout

This option defines an interval of time that the Database Designer for PostgreSQL will try to connect to the PostgreSQL server.

3. Here you can choose what tablespaces should be created before CREATE DATABASE statement execution.

4. This step allows you to tune parameters of a new database. The dialog shows the parameters you already set by using Database Editor. But it's possible to tune them here.

4. The final step of the wizard allows you to chose if you want to create a new connection profile for the database. Additionally, it shows the process and result of database creation.

To start creating the database with all the parameters you have set, click the Finish button.

After wizard has finished, the Database Generation process will continue if the wizard had been launched from it.

9.2. Database Generation

The Database Generation tool can generate SQL script, that represents the diagram you developed and executes it on the database server.

You can generate database in two ways:

Directly execute a script on a PostgreSQL server. Please examine Connect to a Database section to explore the database connection process;

Generate a script to be executed on PostgreSQL server at a later time.

In both cases, the database generation commands are saved in a script file. You must always provide path to the script file.

To generate database, start the Database Generation tool by selecting the Database | Generate Database menu item or pressing Ctrl-G. Database Generation tool consist of five tabs, which contain SQL generation options. Let's explore them. The following pictures demonstrate Database

Generation tool interface.

Database Generation

File name

This field allows you to set file, in which generated SQL statements will be stored. Click on the ...

button near the field to browse to file on the file system.

Related documents