Book a Demo

Author Topic: Generate Postgresql DDL?  (Read 6477 times)

stanleytech421

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Generate Postgresql DDL?
« on: June 30, 2004, 02:15:47 pm »
I am using EA corporated Edition 4.00.726.  In the database modeling, I can only see DB2, Access, MySQL, Oracle and MS SQL under the "database".  It doesn't seem to support Postgresql?  But in the release note, it said the corporated edition support Postgresql starting from build 720.  Am I missing something?  Or can anybody give any idea?
Thanks,
Stan

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #1 on: June 30, 2004, 03:23:37 pm »
PostgreSQL support as a DBMS back-end repository which means that EA supports PostgreSQL for the purposes of storing a UML model.

I'm running Build 730 (V4.1) and I do have PostgreSQL in the drop down list of a table.
« Last Edit: June 30, 2004, 03:25:22 pm by AdamHearn »

stanleytech421

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #2 on: July 01, 2004, 08:36:14 am »
Quote
PostgreSQL support as a DBMS back-end repository which means that EA supports PostgreSQL for the purposes of storing a UML model.

I'm running Build 730 (V4.1) and I do have PostgreSQL in the drop down list of a table.


Thanks for clearifying the "Postgresql support".  I upgraded my EA 4.0 to the latest EA 4.1.730, but in the data model, in the table properties dialog, "Postgresql" is still not in the dropdown list of "database".  Did you add the Postgresql database type and its data type by "Configuration"->"Database datatypes..."?  But even doing that won't help generating DDL in Postgresql dialect, right?

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #3 on: July 01, 2004, 12:16:56 pm »
I haven't needed to manually add/modify anything for it to appear in my list.

One thing does spring to mind... is this an old model file or a brand new one? I'm 100% sure but I'd expect that the EAP file (assuming you're not using a remote repository) will only contain the types from the EABase supplied at a particular version of EA. So, if Sparx add/change things then a program update will not [necessarily] update the EAP. Having, I've been using EA for around 2 years now and that have needed to run a DB update between a couple of the versions.

If it's an old project, create a new one and see if the DB list is more complete. Open the EAP up in Access and look at the t_datatypes table for ProductName entries relating to PostreSQL. If they don't exist, open the EA template file (usually EABase) you used to create the EAP and check for the same entries.

Finally, the EA help file shows the same list content as I have:
mk:@MSITStore:C:\Program%20Files\Sparx%20Systems\EA\EA.chm::/dbmsdatatypemapper.htm

You'll find the topic:
Modeling with UML -> DataModelling -> DBMS Datatype Mapper

Hope that helps!

stanleytech421

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #4 on: July 01, 2004, 05:11:28 pm »
Got it!  Thanks a lot!!  I think you are right.  The db datatypes info is in the EAP file.  So even after upgrading the EA software, the old project (stored in the old EAP file) is not upgraded automatically.  I did found the Postgresql datatypes definition in the "t_datatypes" access table of the new EAP file created in the new EA software.  And those Postgresql types are not in the old EAP files.

I tried to find how to upgrade the EAP file but did not find since I am quite new to EA.  Is manually replacing the old "t_datatypes" table with the new one a possible solution?  But I just feel it a bit dangerous, since how other tables refer to this one is not clear.  Is there any other better method (preferably with some provided EA tools) except hacking the EAP file manually?

Thanks!

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #5 on: July 02, 2004, 12:18:08 am »
I'd not manually update the tables but rather recommend an export of your old model which can then be used to import into a new model. This should get you a new set of base definitions with your old model.

Load up the old model.
In the Project View, right click on Views
Select Export Model to XML
Populate dialog as you require.
Create a new model
Right click on Views
Select Import Model from XML

I've just tried it on a rather large model (15MB XML output) and it seemed to import without issue.

stanleytech421

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Generate Postgresql DDL?
« Reply #6 on: July 02, 2004, 03:50:04 pm »
Thanks for the detailed instruction!  Yes, it worked very nicely, except that the originally stored a list of author names is gone after the export and import.  But it's no big deal and I can fix it with "tools"->"ex/import reference data...".

But I'd like to suggest the sparxsystems to provide an  additional tool (maybe under the "tools" menu item) to upgrade an existing project EAP file to the latest version without manually exporting and importing :)  This will include upgrading all the reference data and merging the new released reference data (e.g., the new Postgresql datatypes) and user's own reference data (e.g., user may have added some postgresql datatype manually before the upgrading).  Also I'd suggest them to make the Postgresql datatype more complete (e.g., date, time, ... are not available now).

Thank you for your help with this issue!
Have a great day!
Stan
« Last Edit: July 02, 2004, 03:51:34 pm by stanleytech421 »