SQL Scripts PostgreSQL

Before you set up EA for use with PostgreSQL, we recommend you run the Tools | Data Management | Data Integrity tool on the base project you wish to upsize to PostgreSQL. This will ensure data is 'clean' before uploading.

 

Warning: Before proceeding, ensure MDAC 2.6 or 2.7 is installed on your system.

 

 

Upsizing Your Database

There are four stages to upsizing your database for PostgreSQL. Follow them in order:

 

Stage One: Install PostgreSQL Components

 

1. Install PostgreSQL - version 7.3.2 or higher.

 

2. Install psqlODBC - version 7.03.01.00 or higher.

 

3. Create a suitable ODBC Data Source to point to your new database.

 

Note: See Set up a PostgreSQL ODBC Driver.

 

 

Stage Two: Configure the Database

 

1. From the psql command line, or using a tool such as EMS PostgreSQL Manager, load the Postgres_Basemodel.sql file. This is available to registered users on the Corporate Edition resources page of the Sparx website at http://www.sparxsystems.com/registered/reg_ea_corp_ed.html.

 

2. Run the script to create all required tables/indexes etc.

 

Note: See Create a New PostgreSQL Repository.

 

 

Stage Three: Transfer the Data

You now have an empty database - you can use the Tools | Data Management | Data Transfer menu option to transfer an existing model into the server.

 

1. Open EA.

 

2. Go to the Tools | Data Management | Data Transfer menu option. This will open the Full Model Transfer Dialog.

 

 

Postgre-FullModelDataTransfer

 

 

3. Select .EAP to DBMS as the Data Transfer Type.

 

4. Click the Browse [...] button to the right of the Source Model and locate the .EAP file to upsize to PostgreSQL.

 

5. Click the Browse [...] button to the right of the Target Model. This will open the Datalink Properties Dialog.

 

6. Select "Microsoft OLE DB Provider for ODBC Drivers" from the list, then press the Next button.

 

7. From the Use data source name drop down list, select the ODBC Data Source you configured to point to your new database.

 

Note: See Connect to a PostgreSQL Data Repository for more information.

 

8. Press OK.

 

9. If desired, check the Logfile checkbox and enter a path for the data transfer log file.

 

10. Press the Transfer Data button to begin the data transfer process.

 

Once the process is completed, you will have upsized your model to PostgreSQL and can now open it from EA