Maybe I failed to get the install working with two compatible versions of emaj_web and emaj (=> clarify documentation).
Or, there might be some mismatch between emaj structure and emaj_web requirements (=> patch this).
I seems to me that, looking at the code, some of these fields might exists in some versions. Because I'm unsure, I group these issues into one github issue.
Seen on PostgreSQL version: 15.3. PostgreSQL and LAMP in two Docker containers. Scripted install.
E-Maj button in Emaj_web says: E-Maj environment consistency: Dignostics: No error detected
On fresh install (downloaded today) of emaj and emaj_web, I have several issues with emaj_web.
emaj.emaj_param says: emaj_version is '' (without the quotes). param_value_numeric, param_value_boolean, param_value_interval are null.
Trying to upgrade emaj extension to devel fails:
ALTER EXTENSION emaj UPDATE;
NOTICE: version "devel" of extension "emaj" is already installed
Below are the issues, separated by lines.
Issue 1
Roolback (with comment) and a few other things do not work with emaj_web
In emaj_web, making a logged rollback with a comment raises a "function does not exist" error:
SQL error:
ERROR: function emaj.emaj_logged_rollback_group(unknown, unknown, boolean, unknown) does not exist
LINE 1: SELECT * FROM emaj.emaj_logged_rollback_group('group_exo','R...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
In statement:
SELECT * FROM emaj.emaj_logged_rollback_group('group_exo','RLBK_RLBK_mark3_10.25.40.2022_DONE_10.28.54.4201_START',true,'comment logged rollback')
-- Same when launching this SQL command in pgadmin:
SELECT * FROM emaj.emaj_rollback_group('group_exo', 'EMAJ_LAST_MARK', false, 'test rollback');
ERROR: function emaj.emaj_rollback_group(unknown, unknown, boolean, unknown) does not exist
LINE 1: SELECT * FROM emaj.emaj_rollback_group('group_exo', 'EMAJ_LA...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- Hint is not useful here. the comment input parameter is not implemented in the version I have for emaj.emaj_rollback_group
-- this works
but this works:
SELECT * FROM emaj.emaj_rollback_group('group_exo', 'EMAJ_LAST_MARK', false);
-- rlbk_message: 0 / 4 tables effectively processed.
I think, same issue with logged rollback (if comments are wanted)
Issue 2
Clicking the E-maj Rollbacks red icon on emaj_web
SQL error:
ERROR: column "rlbk_start_datetime" does not exist
LINE 2: to_char(rlbk_start_datetime,'YYYY/MM/DD HH24:MI:SS.US ...
^
In statement:
SELECT rlbk_id, array_to_string(rlbk_groups,', ') as rlbk_groups_list, rlbk_status,
to_char(rlbk_start_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_start_datetime,
to_char(rlbk_end_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_end_datetime,
to_char(rlbk_end_datetime - rlbk_start_datetime, 'DD HH24:MI:SS.US') as rlbk_duration,
rlbk_mark, rlbk_is_logged, rlbk_nb_session, rlbk_comment
FROM emaj.emaj_rlbk
WHERE rlbk_status IN ('COMPLETED','COMMITTED','ABORTED')
ORDER BY rlbk_id DESC
LIMIT 1000
When trying to perform a rollback with emaj_web:
E-Maj: Rollback a tables group
Rollback execution report for the tables groups "group_exo" to the mark "del c"
SQL error:
ERROR: function emaj.emaj_logged_rollback_group(unknown, unknown, boolean, unknown) does not exist
LINE 1: SELECT * FROM emaj.emaj_logged_rollback_group('group_exo','d...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
In statement:
SELECT * FROM emaj.emaj_logged_rollback_group('group_exo','del c',true,'undo del c')
Issue 3
On emaj_web, clicking Rollbacks E-Maj (red arrow) on the left also gives:
Erreur SQL :
ERROR: column "rlbk_comment" does not exist
-- LINE 5: rlbk_mark, rlbk_is_logged, rlbk_nb_session, rlbk_comme...
^
-- Dans l'instruction :
SELECT rlbk_id, array_to_string(rlbk_groups,', ') as rlbk_groups_list, rlbk_status,
to_char(rlbk_start_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_start_datetime,
to_char(rlbk_end_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_end_datetime,
to_char(rlbk_end_datetime - rlbk_start_datetime, 'DD HH24:MI:SS.US') as rlbk_duration,
rlbk_mark, rlbk_is_logged, rlbk_nb_session, rlbk_comment
FROM emaj.emaj_rlbk
WHERE rlbk_status IN ('COMPLETED','COMMITTED','ABORTED')
ORDER BY rlbk_id DESC
LIMIT 1000
-- I fixed part of the above with this:
ALTER TABLE emaj.emaj_rlbk
ADD COLUMN IF NOT EXISTS rlbk_start_datetime timestamp with time zone,
ADD COLUMN IF NOT EXISTS rlbk_comment varchar;
Adding COLUMN rlbk_start_datetime helps to display the "Completed E-Maj rollbacks" table
-- I'll be happy to work on a patch here, if it helps.
Issue 4
-- But even after this hot-fix, Emaj_web's "Rollback start" is still empty.
-- and "Consolidable E-Maj logged rollbacks" table fails (the field is needed in the function too) with:
SQL error:
ERROR: column "rlbk_comment" does not exist
LINE 7: rlbk_completion_pct, rlbk_comment FROM emaj.emaj_rollba...
^
In statement:
SELECT rlbk_id, array_to_string(rlbk_groups,', ') AS rlbk_groups_list, rlbk_mark,
to_char(rlbk_mark_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_mark_datetime,
rlbk_is_logged, rlbk_nb_session, rlbk_nb_table, rlbk_nb_sequence, rlbk_eff_nb_table, rlbk_status,
to_char(rlbk_start_datetime,'YYYY/MM/DD HH24:MI:SS.US OF') AS rlbk_start_datetime,
to_char(rlbk_elapse,'DD HH24:MI:SS.US') AS rlbk_current_elapse,
to_char(rlbk_remaining, 'DD HH24:MI:SS.US') AS rlbk_remaining,
rlbk_completion_pct, rlbk_comment FROM emaj.emaj_rollback_activity()
ORDER BY rlbk_id DESC
Thank you.