Skip to content

Commit

Permalink
Move the information about the application triggers to ignore at roll…
Browse files Browse the repository at this point in the history
…back time from the emaj_ignored_app_trigger table to the emaj_relation table. When importing a tables group configuration with changes on triggers to ignore for a table, record and report into emaj_hist the change as other changes on tables. In passing, fix a minor bug: when the priority level dynamically changed for a table, the priority values reported in the emaj_hist events were truncated to 1 character.
  • Loading branch information
beaud76 committed Oct 3, 2020
1 parent a735a10 commit 86deb5e
Show file tree
Hide file tree
Showing 85 changed files with 2,196 additions and 2,106 deletions.
2 changes: 1 addition & 1 deletion docs/en/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A **log table** has the same structure as its corresponding application table. H

To let E-Maj work, some **other technical objects** are also created at extension installation time:

* 18 tables,
* 16 tables,
* 8 composite and 3 enum types,
* 1 view,
* 2 triggers,
Expand Down
112 changes: 57 additions & 55 deletions docs/en/traces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ The emaj_hist table
-------------------

All operations performed by E-Maj, and that impact in any way a tables group, are traced into a table named *emaj_hist*.


Any user having *emaj_adm* or *emaj_viewer* rights may look at the *emaj_hist* content.

The **emaj_hist** table structure is the following:

+--------------+-------------+------------------------------------------------------------+
Expand Down Expand Up @@ -152,64 +154,64 @@ The *hist_function* column can take the following values:

The *hist_event* column can take the following values:

+------------------------------+---------------------------------------------------------+
| Value | Meaning |
+==============================+=========================================================+
| BEGIN | |
+------------------------------+---------------------------------------------------------+
| DELETED PARAMETER | parameter deleted from *emaj_param* |
+------------------------------+---------------------------------------------------------+
| END | |
+------------------------------+---------------------------------------------------------+
| EVENT TRIGGERS DISABLED | |
+------------------------------+---------------------------------------------------------+
| EVENT TRIGGERS ENABLED | |
+------------------------------+---------------------------------------------------------+
| GROUP_CREATED | new tables group created |
+------------------------------+---------------------------------------------------------+
| INSERTED PARAMETER | parameter inserted into *emaj_param* |
+------------------------------+---------------------------------------------------------+
| LOG DATA TABLESPACE CHANGED | tablespace for the log table modified |
+------------------------------+---------------------------------------------------------+
| LOG INDEX TABLESPACE CHANGED | tablespace for the log index modified |
+------------------------------+---------------------------------------------------------+
| LOG_SCHEMA CREATED | secondary schema created |
+------------------------------+---------------------------------------------------------+
| LOG_SCHEMA DROPPED | secondary schema dropped |
+------------------------------+---------------------------------------------------------+
| MARK DELETED | |
+------------------------------+---------------------------------------------------------+
| NAMES PREFIX CHANGED | E-Maj names prefix modified |
+------------------------------+---------------------------------------------------------+
| NOTICE | warning message issued by a rollback |
+------------------------------+---------------------------------------------------------+
| PRIORITY CHANGED | priority level modified |
+------------------------------+---------------------------------------------------------+
| SEQUENCE ADDED | sequence added to a logging tables group |
+------------------------------+---------------------------------------------------------+
| SEQUENCE MOVED | sequence moved from one group to another |
+------------------------------+---------------------------------------------------------+
| SEQUENCE REMOVED | sequence removed from a logging tables group |
+------------------------------+---------------------------------------------------------+
| TABLE ADDED | table added to a logging tables group |
+------------------------------+---------------------------------------------------------+
| TABLE MOVED | table moved from one group to another |
+------------------------------+---------------------------------------------------------+
| TABLE REMOVED | table removed from a logging tables group |
+------------------------------+---------------------------------------------------------+
| UPDATED PARAMETER | parameter updated in *emaj_param* |
+------------------------------+---------------------------------------------------------+
| WARNING | warning message issued by a rollback |
+------------------------------+---------------------------------------------------------+

The *emaj_hist* content can be viewed by anyone who has the proper access rights on this table (*superuser*, *emaj_adm* or *emaj_viewer* roles).
+------------------------------+----------------------------------------------------------------+
| Value | Meaning |
+==============================+================================================================+
| BEGIN | |
+------------------------------+----------------------------------------------------------------+
| DELETED PARAMETER | parameter deleted from *emaj_param* |
+------------------------------+----------------------------------------------------------------+
| END | |
+------------------------------+----------------------------------------------------------------+
| EVENT TRIGGERS DISABLED | |
+------------------------------+----------------------------------------------------------------+
| EVENT TRIGGERS ENABLED | |
+------------------------------+----------------------------------------------------------------+
| GROUP_CREATED | new tables group created |
+------------------------------+----------------------------------------------------------------+
| INSERTED PARAMETER | parameter inserted into *emaj_param* |
+------------------------------+----------------------------------------------------------------+
| LOG DATA TABLESPACE CHANGED | tablespace for the log table modified |
+------------------------------+----------------------------------------------------------------+
| LOG INDEX TABLESPACE CHANGED | tablespace for the log index modified |
+------------------------------+----------------------------------------------------------------+
| LOG_SCHEMA CREATED | secondary schema created |
+------------------------------+----------------------------------------------------------------+
| LOG_SCHEMA DROPPED | secondary schema dropped |
+------------------------------+----------------------------------------------------------------+
| MARK DELETED | |
+------------------------------+----------------------------------------------------------------+
| NAMES PREFIX CHANGED | E-Maj names prefix modified |
+------------------------------+----------------------------------------------------------------+
| NOTICE | warning message issued by a rollback |
+------------------------------+----------------------------------------------------------------+
| PRIORITY CHANGED | priority level modified |
+------------------------------+----------------------------------------------------------------+
| SEQUENCE ADDED | sequence added to a logging tables group |
+------------------------------+----------------------------------------------------------------+
| SEQUENCE MOVED | sequence moved from one group to another |
+------------------------------+----------------------------------------------------------------+
| SEQUENCE REMOVED | sequence removed from a logging tables group |
+------------------------------+----------------------------------------------------------------+
| TABLE ADDED | table added to a logging tables group |
+------------------------------+----------------------------------------------------------------+
| TABLE MOVED | table moved from one group to another |
+------------------------------+----------------------------------------------------------------+
| TABLE REMOVED | table removed from a logging tables group |
+------------------------------+----------------------------------------------------------------+
| TRIGGERS TO IGNORE CHANGED | set of application triggers to ignore at rollback time changed |
+------------------------------+----------------------------------------------------------------+
| UPDATED PARAMETER | parameter updated in *emaj_param* |
+------------------------------+----------------------------------------------------------------+
| WARNING | warning message issued by a rollback |
+------------------------------+----------------------------------------------------------------+

Other trace data
----------------

Two other internal tables keep traces of groups alter or rollback operations:

* *emaj_alter_plan* lists the elementary steps performed during the execution of :doc:`tables groups structure changes <alterGroups>`,
* *emaj_alter_plan* lists the elementary steps performed during :doc:`tables groups structure changes <alterGroups>`,
* *emaj_rlbk_plan* lists the elementary steps performed during the execution of :ref:`emaj_rollback_group() <emaj_rollback_group>` and related functions.

Purge obsolete traces
Expand All @@ -219,7 +221,7 @@ When a tables group is started, using the :ref:`emaj_start_group() <emaj_start_g

The obsolete traces purge can also be initiated by explicitely calling the :ref:`emaj_purge_histories() <emaj_purge_histories>` function. The input parameter of the function defines a retention delay that overloads the *history_retention* parameter of the *emaj_param* table.

In order to schedule purges periodicaly, it is possible to:
In order to schedule purges periodically, it is possible to:

* set the *history_retention* parameter to a very high value (for instance '100 YEARS'), so that tables groups starts and oldest marks deletions do not perform any purge, and
* schedule by any means (*crontab*, *pgAgent*, *pgTimeTable* or any other tool) purge operations.
* schedule purge operations by any means (*crontab*, *pgAgent*, *pgTimeTable* or any other tool).
2 changes: 1 addition & 1 deletion docs/fr/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Une **table de log** a la même structure que la table applicative correspondant

Pour le bon fonctionnement d'E-Maj, un certain nombre d'**objets techniques** sont également créés à l'installation de cette extension :

* 18 tables,
* 16 tables,
* 8 types composites et 3 énumérations,
* 1 vue,
* 2 triggers,
Expand Down

0 comments on commit 86deb5e

Please sign in to comment.