3.7.1. History viewer

PostgresSQL history viewer plugin allows you to retrieve modification on the QGEP database.

Install the plugin from the QGIS Plugin repository.

../../_images/history_viewer_plugin.jpg

3.7.1.1. Plugin configuration

../../_images/history_viewer_menu.jpg

First, you have to configure the plugin for the session like this:

../../_images/pg_hv_configuration.png

3.7.1.2. Database configuration

Then you need to enable logging on desired tables or views.

  • For views:

    SELECT qgep_sys.audit_view('qgep_od.vw_qgep_wastewater_structure', 'true'::boolean, '{}'::text[], '{obj_id}'::text[]);
    
  • For tables:

    SELECT qgep_sys.audit_table('qgep_od.reach_point');
    

Note

You can disable logging with:

SELECT qgep_sys.unaudit_view('qgep_od.vw_qgep_wastewater_structure');
SELECT qgep_sys.unaudit_table('qgep_od.reach_point');

3.7.1.3. Usage

The « logged events » window is composed of 4 parts.

../../_images/pg_hv_history.png
    1. Part identifying the tools used to filter modifications in the database.

    1. Logged events with the modification date, the table, the action type « Update/Delete/Insert », the application and the user who made the modification.

    1. The view comparing the data before and after the change. The red lines are the ones modified.

    1. If the geometry has been modified, a canvas will show the difference.

3.7.1.4. Replay function

If you have configured the replay option, you can replay actions. Example below:

Actual value:

../../_images/pg_hv_replay_before.png

Select the event you want to replay and its values will become the current ones. Example for the year that becomes 2004 again:

../../_images/pg_hv_replay_after.png