Creation, migration and synchronization of PostgreSQL/PostGIS databases from a geobase or a folder tree.
References to COVADIS, geobase folders and the gb_cons, gb_prod and gb_ref supports are specific to the MTATV and its decentralized services. They describe a particular organizational context and are not a requirement for using the plugin. Qgis PostGIS Sync can be used by any other organization, public authority, local authority or company wishing to convert and manage its data assets in PostgreSQL/PostGIS. When a geobase is used, a small Marianne marker appears in the interface to indicate this specific context.
To ensure that QGIS can automatically restore all resources and configurations stored in the database by Qgis PostGIS Sync — including styles, forms, widgets, actions, joins, relations, layer dependencies, SVG files, attachments and other resources — the plugin must remain installed and enabled on every QGIS workstation using these PostGIS layers.
The PostgreSQL/PostGIS server connection configured in the Qgis PostGIS Sync interface is only required to create, upgrade or synchronize a database. For day-to-day use of layers in QGIS, users may use their usual QGIS PostgreSQL/PostGIS connection; the plugin then remains active in the background to automatically restore resources and relations stored in the database.
The application accepts two source modes:
gb_cons, gb_prod ou gb_ref. The chosen folder is always included and the two other detected media can be added to the scope.gb_cons/gb_prod/gb_ref.For a geobase, choose the supports to include before launchingAnalyze the perimeter. Any modification of the scope after an analysis requires a new analysis.
The analysis inventories data, calculates target schemas and tables, identifies QML/QGZ styles, dependencies, joins, attachments, SVGs, forms, scripts and rasters.
In multi-media mode,gb_cons, gb_prod et gb_refare analyzed successively with an overall progression.The table indicates the source of each item.
A geobase feeds a single base named according to the conventiongeobase_<structure><department>, For examplegeobase_ddt04.
| Support source | Schema prefix | Usage |
|---|---|---|
gb_cons | cons_* | Consultation / publication data |
gb_prod | prod_* | Production and work data |
gb_ref | ref_* | Repositories |
An independent folder produces a generic base derived from the folder name and schemas derived from its tree structure.
After analysis, choose the appropriate mode:creating a database, using and upgrading an existing database, or synchronizing changes.For a multi-support geobase, the selected supports are processed consecutively in the same base.
The manifest memorizes the state of the files in order to avoid unnecessary processing and to detect additions, modifications and deletions in the active scope.
The plugin preserves or reconstructs as much as possible the elements necessary for QGIS use:
ValueRelation et ExternalResource ;The QML and QGZ/QGS configurations are merged by complementarity, without overall priority of one source over the other. Absent properties are added, collections are merged element by element and, in the event of a strict conflict on the same property, the structurally richest configuration is retained with logging. Standalone dependencies are stored in tables_ADMIN.
The resource loader only controls real vector layers whose QGIS provider is PostgreSQL.An SHP, GeoPackage, WFS, memory, or other format layer is ignored, even if it has the exact same name as a PostGIS table.
This avoids unwanted messages about unloaded resources on local layers that do not come from the base.
The GeoPackage rasters located in particular undergb_ref/CARTES/SCAN_25, SCAN_100 et SCAN_REGare identified as rasters and imported into PostGIS Raster. The plugin enables supportpostgis_rasterwhen available, reads the SRID of the GeoPackage subset and verifies that the target table actually contains raster tiles.
If opening a GPKG subgame directly fails on Windows, a temporary VRT can be used as a fallback.
The number of 256 × 256 pixel blocks is determined during analysis.Rasters of 10,000 blocks or less are processed normally.Beyond 10,000 blocks, a non-modal window allows the operator to choose which rasters to process or ignore.The synchronization rules with an existing geobase remain applicable.
During raster processing, the commandSkip this rasterallows you to interrupt only the current raster without stopping the entire batch.
For historical VRTs reading ODS spreadsheets with fieldsField1, Field2, etc., the plugin forces a deterministic reading of headers and types so that join fields remain available in QGIS.
The categorized styles can thus find the thematic field coming from the join, for exampleGROUPE6.
The Carto2 tab controls the tables intended for publication:primary key, geometry, SRID, empty or problematic geometries, spatial index and other technical points.Safe corrections can be applied automatically and are logged in reports.
SQL relationships equivalent to QGIS joins are only created when consistency checks allow this to be done without modifying the data.
Analyzes and processing generate reports and logs to identify applied, refused, ambiguous or unresolved operations.The Carto2 general report and control folders are configurable.
The window remains in the foreground until processing is started.During a long task it can move behind QGIS, then automatically return to the foreground when the task finishes.
PGDATAbefore a large import.gb_cons/gb_prod/gb_ref, restart the analysis before importing.The standalone version uses the analysis and migration engine without requiring QGIS on the target workstation. It can use an existing PostgreSQL/PostGIS server or the embedded PostgreSQL/PostGIS runtime. The data folderPGDATAremains separate from the program and configurable.
Qgis PostGIS Sync — integrated documentation.