diff --git a/config.h.in b/config.h.in index b9a9f0a..b279d78 100644 --- a/config.h.in +++ b/config.h.in @@ -12,8 +12,8 @@ #ifndef SLONY_I_CONFIG_H #define SLONY_I_CONFIG_H -#define SLONY_I_VERSION_STRING "2.0.2" -#define SLONY_I_VERSION_STRING_DEC 2,0,2 +#define SLONY_I_VERSION_STRING "2.0.3" +#define SLONY_I_VERSION_STRING_DEC 2,0,3 #ifndef PG_VERSION_MAJOR #define PG_VERSION_MAJOR 0 diff --git a/src/backend/slony1_funcs.sql b/src/backend/slony1_funcs.sql index e1f794e..83b2e5a 100644 --- a/src/backend/slony1_funcs.sql +++ b/src/backend/slony1_funcs.sql @@ -3977,130 +3977,6 @@ Set the enable/disable configuration for the replication triggers according to the origin of the set.'; -- ---------------------------------------------------------------------- --- FUNCTION alterTableRestore (tab_id) --- ---------------------------------------------------------------------- -create or replace function @NAMESPACE@.alterTableRestore (int4) -returns int4 -as $$ -declare - p_tab_id alias for $1; - v_no_id int4; - v_tab_row record; - v_tab_fqname text; - v_n int4; -begin - -- ---- - -- Grab the central configuration lock - -- ---- - lock table @NAMESPACE@.sl_config_lock; - - -- ---- - -- Get our local node ID - -- ---- - v_no_id := @NAMESPACE@.getLocalNodeId('_@CLUSTERNAME@'); - - -- ---- - -- Get the sl_table row and the current tables origin. Check - -- that the table currently IS in altered state. - -- ---- - select T.tab_reloid, T.tab_set, T.tab_altered, - S.set_origin, PGX.indexrelid, - @NAMESPACE@.slon_quote_brute(PGN.nspname) || '.' || - @NAMESPACE@.slon_quote_brute(PGC.relname) as tab_fqname - into v_tab_row - from @NAMESPACE@.sl_table T, @NAMESPACE@.sl_set S, - "pg_catalog".pg_class PGC, "pg_catalog".pg_namespace PGN, - "pg_catalog".pg_index PGX, "pg_catalog".pg_class PGXC - where T.tab_id = p_tab_id - and T.tab_set = S.set_id - and T.tab_reloid = PGC.oid - and PGC.relnamespace = PGN.oid - and PGX.indrelid = T.tab_reloid - and PGX.indexrelid = PGXC.oid - and PGXC.relname = T.tab_idxname - for update; - if not found then - raise exception 'Slony-I: alterTableRestore(): Table with id % not found', p_tab_id; - end if; - v_tab_fqname = v_tab_row.tab_fqname; - if not v_tab_row.tab_altered then - raise exception 'Slony-I: alterTableRestore(): Table % is not in altered state', - v_tab_fqname; - end if; - - execute 'lock table ' || v_tab_fqname || ' in access exclusive mode'; - - -- ---- - -- Procedures are different on origin and subscriber - -- ---- - if v_no_id = v_tab_row.set_origin then - -- ---- - -- On the Origin we just drop the trigger we originally added - -- ---- - execute 'drop trigger "_@CLUSTERNAME@_logtrigger_' || - p_tab_id::text || '" on ' || v_tab_fqname; - else - -- ---- - -- On the subscriber drop the denyAccess trigger - -- ---- - execute 'drop trigger "_@CLUSTERNAME@_denyaccess_' || - p_tab_id::text || '" on ' || v_tab_fqname; - - -- ---- - -- Restore all original triggers - -- ---- - update "pg_catalog".pg_trigger - set tgrelid = v_tab_row.tab_reloid - where tgrelid = v_tab_row.indexrelid; - get diagnostics v_n = row_count; - if (v_n > 0) and exists (select 1 from information_schema.columns where table_name = 'pg_class' and table_schema = 'pg_catalog' and column_name = 'reltriggers') then - update "pg_catalog".pg_class - set reltriggers = reltriggers + v_n - where oid = v_tab_row.tab_reloid; - end if; - - -- ---- - -- Restore all original rewrite rules - -- ---- - update "pg_catalog".pg_rewrite - set ev_class = v_tab_row.tab_reloid - where ev_class = v_tab_row.indexrelid; - get diagnostics v_n = row_count; - if v_n > 0 then - update "pg_catalog".pg_class - set relhasrules = true - where oid = v_tab_row.tab_reloid; - end if; - - end if; - - -- ---- - -- Mark the table not altered in our configuration - -- ---- - update @NAMESPACE@.sl_table - set tab_altered = false where tab_id = p_tab_id; - - return p_tab_id; -end; -$$ language plpgsql; -comment on function @NAMESPACE@.alterTableRestore (int4) is -'alterTableRestore (tab_id) - -Note: This function only functions properly when used on pre-2.0 -systems being converted into 2.0 form. In Slony-I 2.0, the trigger -handling has changed substantially, such that: - -- There are *two* triggers on each table, created at "creation time", and -- There is no need to run "restore" as part of the DDL/EXECUTE SCRIPT process. - -Restores table tab_id from being replicated. - -On the origin, this simply involves dropping the "logtrigger" trigger. - -On subscriber nodes, this involves dropping the "denyaccess" trigger, -and restoring user triggers and rules.'; - --- ---------------------------------------------------------------------- -- FUNCTION subscribeSet (sub_set, sub_provider, sub_receiver, sub_forward, omit_copy) -- ---------------------------------------------------------------------- create or replace function @NAMESPACE@.subscribeSet (int4, int4, int4, bool, bool) diff --git a/tests/poll_cluster.sh b/tests/poll_cluster.sh old mode 100644 new mode 100755 diff --git a/tests/run_test.sh b/tests/run_test.sh old mode 100644 new mode 100755 diff --git a/tools/check_slon.sh b/tools/check_slon.sh old mode 100644 new mode 100755 diff --git a/tools/check_slony_cluster.sh b/tools/check_slony_cluster.sh old mode 100644 new mode 100755 diff --git a/tools/configure-replication.sh b/tools/configure-replication.sh old mode 100644 new mode 100755 diff --git a/tools/duplicate-node.sh b/tools/duplicate-node.sh old mode 100644 new mode 100755 diff --git a/tools/find-triggers-to-deactivate.sh b/tools/find-triggers-to-deactivate.sh old mode 100644 new mode 100755 diff --git a/tools/generate_syncs.sh b/tools/generate_syncs.sh old mode 100644 new mode 100755 diff --git a/tools/launch_clusters.sh b/tools/launch_clusters.sh old mode 100644 new mode 100755 diff --git a/tools/mkslonconf.sh b/tools/mkslonconf.sh old mode 100644 new mode 100755 diff --git a/tools/pull-gborg-mail.sh b/tools/pull-gborg-mail.sh old mode 100644 new mode 100755 diff --git a/tools/release_checklist.sh b/tools/release_checklist.sh old mode 100644 new mode 100755 diff --git a/tools/run_rep_tests.sh b/tools/run_rep_tests.sh old mode 100644 new mode 100755 diff --git a/tools/search-logs.sh b/tools/search-logs.sh old mode 100644 new mode 100755 diff --git a/tools/slony-cluster-analysis-mass.sh b/tools/slony-cluster-analysis-mass.sh old mode 100644 new mode 100755 diff --git a/tools/slony-cluster-analysis.sh b/tools/slony-cluster-analysis.sh old mode 100644 new mode 100755 diff --git a/tools/slony1_dump.sh b/tools/slony1_dump.sh old mode 100644 new mode 100755 diff --git a/tools/slony_bulkload/bulk_load_for_slony.pl b/tools/slony_bulkload/bulk_load_for_slony.pl index 5242b9d..b3c3872 100644 --- a/tools/slony_bulkload/bulk_load_for_slony.pl +++ b/tools/slony_bulkload/bulk_load_for_slony.pl @@ -184,9 +184,8 @@ parses the configuration file. It builds a COPY statement to load the bulk file into the target table, and then connects to each node in turn. It checks to make sure that there are as many nodes listed in sl_node as are configured in its configuration file. It learns the -table identifier for Slony by querying the cluster's sl_table table, -then removes that table from replication by calling the -altertablerestore() function. It then runs its COPY query. It checks +table identifier for Slony by querying the cluster's sl_table table. +It then runs its COPY query. It checks the return value of the copy query. If that returns OK, then it retores the table to replication using the altertableforreplication() function. @@ -338,15 +337,6 @@ foreach my $connopt (@connstr) { print "Slony thinks it has $slnodes nodes\n"; die "Mismatch!\n"; } - # now that we have the table id, disable it in replication - $qstring = "SELECT " . $slonyschem; - $qstring = $qstring . ".altertablerestore(" . $tab_id . ")"; - my $replic_change = $conn->exec($qstring); - unless (($replic_change->resultStatus) eq PGRES_TUPLES_OK) { - print "PANIC: failed attempting to disable replication\n"; - printf ("Result is %s\n",($replic_change->resultStatus)); - die "Could not disable replication on connection $connopt\n"; - } # perform the bulk load my $bulk_load = $conn->exec($copystmt); my $errstat = ($bulk_load->resultStatus); diff --git a/tools/start_slon.sh b/tools/start_slon.sh old mode 100644 new mode 100755