Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Create a Project in a PostgreSQL Database

To create a project in a repository on PostgreSQL, you work through these stages:

  • Stage 1: Create an empty database repository and set up the data tables
  • Stage 2: Set up the PostgreSQL ODBC Driver
  • Stage 3: Set up initial model data


  • A machine with PostgreSQL 9 or higher installed and running
  • psqlODBC, version 8.03 or higher has been installed (do not use version 8.3.4 or 8.4.1)

1. Create Database Repository



See also


Create the empty database and configure it to your installation's defaults.

Create a PostgreSQL Repository


Open your SQL management console of choice (such as pgAdmin) and connect to the new database.


Load the EASchema_1220_PostgreSQL.sql file from the Sparx Systems website.


Run the EASchema_1220_PostgreSQL.sql to create the required database schema.

2. Set up the ODBC DSN



See also


Create a suitable ODBC Data Source to the new database.

Making sure to select these extended options:

Page 1:

  Disable Genetic Optimizer - Uncheck

  Use Declare/Fetch - Check

  Unknowns as LongVarChar - Check

  Bools as Char - Uncheck

  Max Varchar - 1024

  Max LongVarChar - 1000000

Page 2:

  bytea as LO - Check

  Disallow Premature - Check

  Protocol - 7.4+

Set up a PostgreSQL ODBC Driver

3. Set up Initial Data

Enterprise Architect repositories requires a basic amount of reference data to function correctly.

Setting up this initial data can be achieved in 2 different ways:

  1. Transferring the entire contents of an existing model into the new database, or
  2. Load Initial data using a SQL Script

3.1 Load Initial Data - Transfer existing model

If you choose to set up your new database with the contents of an existing model then Sparx Systems recommend that a Project Integrity check is performed on the existing model to ensure it is 'clean' and free from data-related errors before being copied into the new database.

The Enterprise Architect installation provides a model specifically for this purpose; the model is copied into the installation folder and is called EABase.eap. However, if you have customized the various drop-down lists in another model then you might prefer to use that. Regardless of what model you choose to use, the process is the same and is outlined here.



See also


In Enterprise Architect, open the existing repository and select 'Configure > Model > Integrity > Project Integrity' in the ribbon.

Check Project Data Integrity


Ensure that the Action is set to 'Report Only' and that all items in 'Checks to Run' are enabled, then click the Go button.


If Enterprise Architect detects that the existing model contains integrity issues then these will be listed, these should be corrected before continuing with the Project Transfer.


With Enterprise Architect open, ensure that it there is no Project loaded, by selecting 'Close Project' from the  Project list button.


Select the 'Configure > Model > Transfer > Project Transfer' ribbon option.

The 'Project Transfer' dialog displays.


In the 'Transfer Type' panel, select 'File to DBMS'.


In the 'Source Project' field, click on the Browse. button and browse for the name of the project file to copy to the repository.

If the .EAP file has Replication enabled, this must be removed before performing the transfer.

Remove Replication


At the right of the 'Target Project' field, click on the Browse. button.

The 'Datalink Properties' dialog displays.


Select 'Microsoft OLE DB Provider for ODBC Drivers' from the list.

Click on the Next button.


On the 'Use Data Source Name' field, click on the drop-down arrow and select the ODBC Data Source you configured to point to your new database.

Click on the OK button. The 'Project Transfer' dialog redisplays.

Set up a PostgreSQL ODBC Driver


If required, select the 'Logfile' checkbox and type a path and filename for the data transfer log file.


Click on the Transfer button to begin the data transfer process.


When the process is complete, you have created a project on a PostgreSQL database and can now connect to it and open it from Enterprise Architect.

Connect to a PostgreSQL Repository

3.2 Load Initial Data - SQL Script


Open your SQL management console of choice (such as pgAdmin), connect to the new database.


Load the EABase_1220_PostgreSQL.sql file from the Sparx Systems website.


Run EABase_1220_PostgreSQL.sql  to create the required database schema.


  • During the transfer, if an error message displays reporting '...nonstandard use of \\ in a string literal...', set the server variable in the postgresql.conf file to: escape_string_warning = off

Learn more