TDM crashes with a runtime error when generating DDL for a Postgres model

I have a Postgres 9.5 model which has undergone many changes, entities and relationships were copied and renamed.

When I now start the DDL generation for my model TDM reports an error and after that I can only kill the process as it does not respond to any click.

The first error dialog is this:

After clicking OK, the next error is:

This is with TDM 6.3 (64bit) on a Windows 10 computer.

How can I find out which relationship is the reason for the error, so that I can fix the model?

Unfortunately I can not share the model file.

Hello,

I think it will be good to try theses two point. For both you need switch on expert mode (Main Menu - Settings - Options - General - Expert Mode).

  1. Right click on model in Model Explorer and try to run test model. If there are some troubles you should see messaged in Message Explorer. If there some problem exists, you can try Repair model and Test model again(No all error can be fixed automatically by repair). If there are still some errors please write me details from message explorer.

6320.TestRepairModel.png

  1. Open Package Explorer (Menu - Expert Mode - Customization - Package Explorer). Find Package "Generation for PostgreSQL 9.2" and expand it.Package is system so it is locked for normal user you need unlock it for changes. Right click on package and from popup menu choose properties, there is on general tab button unlock. Please press it (It is unset read-only flag on file system on this file).

After it, expand this package. There are one script "PERCodeGeneratorPG92". Please open it by double-click. Find method "CreateRelation_core". There is some problem on line number 1341
...
text += Relation.ForeignKeys.GetObject(i).AttrChild.QuotedFullName(Instance);

...

It is look like foreign key has not foreign key. Try to insert before this line this code:

if (Relation.ForeignKeys.GetObject(i).AttrChild==null)
Log.Information('Problem in relationship '+Relation.Name);

Save this script(button upt to script) and try to generate ddl script again. It should write name of problematic relationship in message explorer. If you identify problematic relationship it will be best solution to delete it and create again.

Unfortunately this process can only repair bug, but we don't know reason of it. Probably there are some problematic operation, that you did. If you identity it please let me know. Thanks

Daril

“Test model” indeed shows the problematic entries.

When I use “Repair Model” TDM crashes with an Access Violation and generated an email with an error report.

I have sent that report and included a link to this topic as a reference. The attached error report has the filename BugReport_11DBEDAB.elp

But as the “Test Model” feature showed me the problematic FKs, so I could I re-created those that were problematic, and now everything works fine.

Thanks for the quick answer.