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).
- 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.
- 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:
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