Skip to content

Commit

Permalink
Minor text editing in the emaj--next_version.sql script.
Browse files Browse the repository at this point in the history
  • Loading branch information
beaud76 committed Sep 17, 2017
1 parent 9885676 commit 3f319fb
Show file tree
Hide file tree
Showing 36 changed files with 85 additions and 82 deletions.
2 changes: 1 addition & 1 deletion sql/emaj--2.1.0--next_version.sql
Expand Up @@ -1615,7 +1615,7 @@ $emaj_create_group$
UPDATE emaj.emaj_group SET group_nb_table = v_nbTbl, group_nb_sequence = v_nbSeq
WHERE group_name = v_groupName;
-- check foreign keys with tables outside the group
PERFORM emaj._check_fk_groups (array[v_groupName]);
PERFORM emaj._check_fk_groups(array[v_groupName]);
-- insert end in the history
INSERT INTO emaj.emaj_hist (hist_function, hist_event, hist_object, hist_wording)
VALUES ('CREATE_GROUP', 'END', v_groupName, v_nbTbl + v_nbSeq || ' tables/sequences processed');
Expand Down
9 changes: 6 additions & 3 deletions sql/emaj--next_version.sql
Expand Up @@ -2330,7 +2330,7 @@ $emaj_create_group$
UPDATE emaj.emaj_group SET group_nb_table = v_nbTbl, group_nb_sequence = v_nbSeq
WHERE group_name = v_groupName;
-- check foreign keys with tables outside the group
PERFORM emaj._check_fk_groups (array[v_groupName]);
PERFORM emaj._check_fk_groups(array[v_groupName]);
-- insert end in the history
INSERT INTO emaj.emaj_hist (hist_function, hist_event, hist_object, hist_wording)
VALUES ('CREATE_GROUP', 'END', v_groupName, v_nbTbl + v_nbSeq || ' tables/sequences processed');
Expand Down Expand Up @@ -7322,7 +7322,8 @@ CREATE OR REPLACE FUNCTION emaj._disable_event_triggers()
RETURNS TEXT[] LANGUAGE plpgsql SECURITY DEFINER AS
$_disable_event_triggers$
-- This function disables all known E-Maj event triggers that are in enabled state.
-- The function is called by functions that alter or drop E-Maj components, such as emaj_drop_group().
-- The function is called by functions that alter or drop E-Maj components, such as
-- _drop_groups(), _alter_groups(), _delete_before_marks_group() and _reset_groups().
-- It is also called by the user emaj_disable_event_triggers_protection() function.
-- Output: array of effectively disabled event trigger names. It can be reused as input when calling _enable_event_triggers()
DECLARE
Expand All @@ -7332,6 +7333,7 @@ $_disable_event_triggers$
IF emaj._pg_version_num() >= 90300 THEN
-- build the event trigger names array from the pg_event_trigger table
-- (pg_event_trigger table doesn't exists in 9.2- postgres versions)
-- A single operation like emaj_alter_groups() may call the function several times. But this is not an issue as only enabled triggers are disabled.
SELECT coalesce(array_agg(evtname ORDER BY evtname),ARRAY[]::TEXT[]) INTO v_eventTriggers
FROM pg_catalog.pg_event_trigger WHERE evtname LIKE 'emaj%' AND evtenabled <> 'D';
-- disable each event trigger
Expand All @@ -7348,7 +7350,8 @@ CREATE OR REPLACE FUNCTION emaj._enable_event_triggers(v_eventTriggers TEXT[])
RETURNS TEXT[] LANGUAGE plpgsql SECURITY DEFINER AS
$_enable_event_triggers$
-- This function enables all event triggers supplied as parameter
-- The function is called by functions that alter or drop E-Maj components, such as emaj_drop_group().
-- The function is called by functions that alter or drop E-Maj components, such as
-- _drop_groups(), _alter_groups(), _delete_before_marks_group() and _reset_groups().
-- It is also called by the user emaj_enable_event_triggers_protection() function.
-- Input: array of event trigger names to enable
-- Output: same array
Expand Down
2 changes: 1 addition & 1 deletion test/10/expected/check.out
Expand Up @@ -140,7 +140,7 @@ select funcname, calls from pg_stat_user_functions
_stop_groups | 57
_verify_all_groups | 35
_verify_all_schemas | 35
_verify_groups | 255
_verify_groups | 254
emaj_alter_group | 43
emaj_alter_groups | 13
emaj_cleanup_rollback_state | 235
Expand Down
4 changes: 2 additions & 2 deletions test/92/expected/adm1.out
Expand Up @@ -397,10 +397,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/92/expected/adm2.out
Expand Up @@ -770,10 +770,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl2_col21_fkey" on the table "phil's schema3.myTbl2\" references the table "phil's schema3.mytbl4" that is outside the groups (phil's group#3",).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "phil's schema3.phil's tbl1" is referenced by the foreign key "mytbl4_col44_fkey" on the table "phil's schema3.mytbl4" that is outside the groups (phil's group#3",).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/92/expected/alter.out
Expand Up @@ -247,10 +247,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
8 changes: 4 additions & 4 deletions test/92/expected/create_drop.out
Expand Up @@ -266,10 +266,10 @@ alter table myschema2.myTbl6 add foreign key (col61) references myschema2.myTbl7
alter table myschema2.myTbl8 add foreign key (col81) references myschema2.myTbl6 (col61) deferrable;
select emaj.emaj_create_group('myGroup2',true);
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down Expand Up @@ -588,10 +588,10 @@ select emaj.emaj_force_drop_group('myGroup1');

select emaj.emaj_create_group('myGroup2',true);
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
8 changes: 4 additions & 4 deletions test/92/expected/misc.out
Expand Up @@ -1465,10 +1465,10 @@ PL/pgSQL function emaj.emaj_rollback_group(text,text) line 7 at RETURN

select emaj.emaj_create_group('myGroup2');
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down Expand Up @@ -1521,10 +1521,10 @@ PL/pgSQL function emaj.emaj_force_stop_group(text) line 15 at SQL statement

select emaj.emaj_create_group('myGroup2');
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/92/expected/start_stop.out
Expand Up @@ -19,10 +19,10 @@ PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFOR

select emaj.emaj_create_group('myGroup2');
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/92/expected/viewer.out
Expand Up @@ -189,10 +189,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/93/expected/adm1.out
Expand Up @@ -397,10 +397,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/93/expected/adm2.out
Expand Up @@ -769,10 +769,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl2_col21_fkey" on the table "phil's schema3.myTbl2\" references the table "phil's schema3.mytbl4" that is outside the groups (phil's group#3",).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "phil's schema3.phil's tbl1" is referenced by the foreign key "mytbl4_col44_fkey" on the table "phil's schema3.mytbl4" that is outside the groups (phil's group#3",).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
4 changes: 2 additions & 2 deletions test/93/expected/alter.out
Expand Up @@ -247,10 +247,10 @@ PL/pgSQL function emaj._create_tbl(emaj.emaj_group_def,bigint,boolean) line 127
SQL statement "SELECT emaj._create_tbl(r_grpdef, v_timeId, v_isRollbackable)"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 70 at PERFORM
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down
2 changes: 1 addition & 1 deletion test/93/expected/check.out
Expand Up @@ -139,7 +139,7 @@ select funcname, calls from pg_stat_user_functions
_stop_groups | 57
_verify_all_groups | 34
_verify_all_schemas | 34
_verify_groups | 254
_verify_groups | 255
emaj_alter_group | 43
emaj_alter_groups | 13
emaj_cleanup_rollback_state | 235
Expand Down
8 changes: 4 additions & 4 deletions test/93/expected/create_drop.out
Expand Up @@ -266,10 +266,10 @@ alter table myschema2.myTbl6 add foreign key (col61) references myschema2.myTbl7
alter table myschema2.myTbl8 add foreign key (col81) references myschema2.myTbl6 (col61) deferrable;
select emaj.emaj_create_group('myGroup2',true);
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down Expand Up @@ -588,10 +588,10 @@ select emaj.emaj_force_drop_group('myGroup1');

select emaj.emaj_create_group('myGroup2',true);
WARNING: _check_fk_groups: The foreign key "mytbl6_col61_fkey" on the table "myschema2.mytbl6" references the table "myschema2.mytbl7" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
WARNING: _check_fk_groups: The table "myschema2.mytbl6" is referenced by the foreign key "mytbl8_col81_fkey" on the table "myschema2.mytbl8" that is outside the groups (myGroup2).
CONTEXT: SQL statement "SELECT emaj._check_fk_groups (array[v_groupName])"
CONTEXT: SQL statement "SELECT emaj._check_fk_groups(array[v_groupName])"
PL/pgSQL function emaj.emaj_create_group(text,boolean,boolean) line 90 at PERFORM
emaj_create_group
-------------------
Expand Down

0 comments on commit 3f319fb

Please sign in to comment.