Skip to content

Commit

Permalink
In the emaj_param table and the emaj_visible_param view, rename param…
Browse files Browse the repository at this point in the history
…_value_int into param_value_numeric and set its type to NUMERIC. The available parameter types will cover more data types (i.e. flotting point data) and match more closely elementary JSON types, eventhough there is currently no parameter that requires such type.
  • Loading branch information
beaud76 committed Jun 1, 2019
1 parent da9b640 commit b49b3bb
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/en/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The **emaj_param** table structure is the following:
+----------------------+----------+----------------------------------------------------------------+
| param_value_text | TEXT | parameter value, if its type is text (otherwise NULL) |
+----------------------+----------+----------------------------------------------------------------+
| param_value_int | INT | parameter value, if its type is integer (otherwise NULL) |
| param_value_numeric | NUMERIC | parameter value, if its type is numeric (otherwise NULL) |
+----------------------+----------+----------------------------------------------------------------+
| param_value_boolean | BOOLEAN | parameter value, if its type is boolean (otherwise NULL) |
+----------------------+----------+----------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/fr/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ La structure de la table **emaj_param** est la suivante :
+----------------------+----------+----------------------------------------------------------------+
| param_value_text | TEXT | valeur du paramètre, s'il est de type texte (sinon NULL) |
+----------------------+----------+----------------------------------------------------------------+
| param_value_int | INT | valeur du paramètre, s'il est de type entier (sinon NULL) |
| param_value_numeric | NUMERIC | valeur du paramètre, s'il est de type numérique (sinon NULL) |
+----------------------+----------+----------------------------------------------------------------+
| param_value_boolean | BOOLEAN | valeur du paramètre, s'il est de type booléen (sinon NULL) |
+----------------------+----------+----------------------------------------------------------------+
Expand Down
17 changes: 17 additions & 0 deletions sql/emaj--3.0.0--devel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,23 @@ $do$;
-- --
----------------------------------------------

--
-- rename and change the type of the emaj_param.param_value_int column
--
DROP VIEW emaj.emaj_visible_param;
ALTER TABLE emaj.emaj_param ALTER COLUMN param_value_int TYPE NUMERIC;
ALTER TABLE emaj.emaj_param RENAME COLUMN param_value_int TO param_value_numeric;

--
-- recreate the emaj_visible_param view
--
CREATE VIEW emaj.emaj_visible_param WITH (security_barrier) AS
SELECT param_key,
CASE WHEN param_key = 'dblink_user_password' THEN '<masked data>'
ELSE param_value_text END AS param_value_text,
param_value_numeric, param_value_boolean, param_value_interval
FROM emaj.emaj_param;

--
-- drop both grpdef_log_schema_suffix and grpdef_emaj_names_prefix columns from the emaj_group_def table
--
Expand Down
4 changes: 2 additions & 2 deletions sql/emaj--devel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $$Global sequence to identifiy all rows of emaj log tables.$$;
CREATE TABLE emaj.emaj_param (
param_key TEXT NOT NULL, -- parameter key
param_value_text TEXT, -- value if type is text, otherwise NULL
param_value_int BIGINT, -- value if type is bigint, otherwise NULL
param_value_numeric NUMERIC, -- value if type is numeric, otherwise NULL
param_value_boolean BOOLEAN, -- value if type is boolean, otherwise NULL
param_value_interval INTERVAL, -- value if type is interval, otherwise NULL
PRIMARY KEY (param_key)
Expand Down Expand Up @@ -628,7 +628,7 @@ CREATE VIEW emaj.emaj_visible_param WITH (security_barrier) AS
SELECT param_key,
CASE WHEN param_key = 'dblink_user_password' THEN '<masked data>'
ELSE param_value_text END AS param_value_text,
param_value_int, param_value_boolean, param_value_interval
param_value_numeric, param_value_boolean, param_value_interval
FROM emaj.emaj_param;

------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions sql/emaj-devel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $$Global sequence to identifiy all rows of emaj log tables.$$;
CREATE TABLE emaj.emaj_param (
param_key TEXT NOT NULL, -- parameter key
param_value_text TEXT, -- value if type is text, otherwise NULL
param_value_int BIGINT, -- value if type is bigint, otherwise NULL
param_value_numeric NUMERIC, -- value if type is numeric, otherwise NULL
param_value_boolean BOOLEAN, -- value if type is boolean, otherwise NULL
param_value_interval INTERVAL, -- value if type is interval, otherwise NULL
PRIMARY KEY (param_key)
Expand Down Expand Up @@ -635,7 +635,7 @@ CREATE VIEW emaj.emaj_visible_param WITH (security_barrier) AS
SELECT param_key,
CASE WHEN param_key = 'dblink_user_password' THEN '<masked data>'
ELSE param_value_text END AS param_value_text,
param_value_int, param_value_boolean, param_value_interval
param_value_numeric, param_value_boolean, param_value_interval
FROM emaj.emaj_param;

------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions test/10/expected/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------+----------+---------
param_key | text | | not null |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |
Indexes:
Expand Down Expand Up @@ -694,7 +694,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------+----------+---------
param_key | text | | |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |

Expand Down
4 changes: 2 additions & 2 deletions test/10/expected/upgrade_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Tablespace: "tspemaj"
----------------------+----------+-----------+----------+---------
param_key | text | | not null |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |
Indexes:
Expand Down Expand Up @@ -790,7 +790,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------+----------+---------
param_key | text | | |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |

Expand Down
4 changes: 2 additions & 2 deletions test/11/expected/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------+----------+---------
param_key | text | | not null |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |
Indexes:
Expand Down Expand Up @@ -694,7 +694,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------+----------+---------
param_key | text | | |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |

Expand Down
8 changes: 4 additions & 4 deletions test/11/expected/install_psql.out
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ $$Global sequence to identifiy all rows of emaj log tables.$$;
CREATE TABLE emaj.emaj_param (
param_key TEXT NOT NULL, -- parameter key
param_value_text TEXT, -- value if type is text, otherwise NULL
param_value_int BIGINT, -- value if type is bigint, otherwise NULL
param_value_numeric NUMERIC, -- value if type is numeric, otherwise NULL
param_value_boolean BOOLEAN, -- value if type is boolean, otherwise NULL
param_value_interval INTERVAL, -- value if type is interval, otherwise NULL
PRIMARY KEY (param_key)
Expand Down Expand Up @@ -604,7 +604,7 @@ CREATE VIEW emaj.emaj_visible_param WITH (security_barrier) AS
SELECT param_key,
CASE WHEN param_key = 'dblink_user_password' THEN '<masked data>'
ELSE param_value_text END AS param_value_text,
param_value_int, param_value_boolean, param_value_interval
param_value_numeric, param_value_boolean, param_value_interval
FROM emaj.emaj_param;
------------------------------------
-- --
Expand Down Expand Up @@ -8135,7 +8135,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------+----------+---------
param_key | text | | not null |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |
Indexes:
Expand Down Expand Up @@ -8494,7 +8494,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------+----------+---------
param_key | text | | |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |

Expand Down
4 changes: 2 additions & 2 deletions test/12/expected/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------+----------+---------
param_key | text | | not null |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |
Indexes:
Expand Down Expand Up @@ -694,7 +694,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------+----------+---------
param_key | text | | |
param_value_text | text | | |
param_value_int | bigint | | |
param_value_numeric | numeric | | |
param_value_boolean | boolean | | |
param_value_interval | interval | | |

Expand Down
4 changes: 2 additions & 2 deletions test/95/expected/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------
param_key | text | not null
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |
Indexes:
Expand Down Expand Up @@ -729,7 +729,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------
param_key | text |
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |

Expand Down
4 changes: 2 additions & 2 deletions test/95/expected/upgrade_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ Tablespace: "tspemaj"
----------------------+----------+-----------
param_key | text | not null
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |
Indexes:
Expand Down Expand Up @@ -951,7 +951,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------
param_key | text |
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |

Expand Down
4 changes: 2 additions & 2 deletions test/96/expected/install.out
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ primary key, btree, for table "emaj.emaj_mark"
----------------------+----------+-----------
param_key | text | not null
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |
Indexes:
Expand Down Expand Up @@ -730,7 +730,7 @@ Owned by: emaj.emaj_time_stamp.time_id
----------------------+----------+-----------
param_key | text |
param_value_text | text |
param_value_int | bigint |
param_value_numeric | numeric |
param_value_boolean | boolean |
param_value_interval | interval |

Expand Down

0 comments on commit b49b3bb

Please sign in to comment.