5.1. Export a model

The exporting process consists in translate the database model objects in different formats. Currently, pgModeler is capable to export the model to PNG and SVG formats which can be useful for documentation purposes, to a SQL script file that can be used in a later execution and directly to a database server. For this last modality it is highly recommend that a backup of the database is made before start the exporting process because there may be data loss.

5.1.1. Export to database server

Field/Option Description
Connection This combo holds the connections to be used in the export process.
PostgreSQL This field specifies the PostgreSQL version in which the SQL code should be generated. It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for test purposes.
Drop Causes objects to be dropped before or during the process. If DB is checked pgModeler will destroy the database if already exists on the server and then start the export. When Objects is checked pgModeler will execute the DROP command attached to SQL-enabled objects. This option leads to data loss so make sure to have a backup before exporting.
Ignore object duplicity This option makes pgModeler ignore errors generated by duplicated objects and creates only that ones which does not exists in the database. This option may be used when an object was created after a previous model export. Note that this option acts differently from the model­database diff because only new objects are created on the server­. If there are objects that were only modified in some attributes they will continue not being created or updated on the server. In that case you'll need to use the model-­database diff feature.
Ignore error codes This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section Appendix A. PostgreSQL Error Codes. Use this option with extreme care since it can interfere in final export result.


5.1.2. Export to SQL file

Field/Option Description
File The output file which will store all the generated DDL commands.
PostgreSQL This option is used to define the PostgreSQL version of the generated SQL file. Unlike the exporting to database server this option is mandatory because pgModeler doesn't know how to identify the proper version just from the database model metadata information.


5.1.3. Export to PNG or SVG

Field/Option Description
Type The type of the graphics being generated: PNG or SVG.
File The output file which will store the graphical representation of the model.
Zoom Causes pgModeler to apply a zoom factor before generate the image file. This option is useful when you need to create a high ­resolution PNG file by setting up a zoom factor more than 100%.
Show grid Enables the orientation grid to be included in the output graphics file.
Show delimiters Enables the page delimiters to be included in the output graphics file.
Page by page Exporting the model page by page will generate files with a _p[n] suffix where n is the page id. Check if the current user has write permission on output folder. The page dimensions and amount are directly linked to current page settings. Refer to section Printing & Code on previous chapter to get details about page configuration.


Once selected the export mode and configured all desired options you just need to click Export button and wait the progress in the Output tab. If no error was raised you can close the dialog or start a new exporting process.


Aug 28, 2018 at 14:53