Fix for bug154.
authorSteve Singer <ssinger@ca.afilias.info>
Mon, 13 Sep 2010 20:38:25 +0000 (16:38 -0400)
committerSteve Singer <ssinger@ca.afilias.info>
Mon, 13 Sep 2010 20:38:25 +0000 (16:38 -0400)
Call updateRelName from the ddlScript_complete_int function instead of ddlScript_complete
 because we want this function to be called on both subscribers and the origin.

This issue addresses something like renaming a table via EXECUTE SCRIPT where
sl_table will continue to have the old name on subscribers.
(cherry picked from commit dfd8816556017fb0a3316b799accf617907c9b62)

src/backend/slony1_funcs.sql

index 4953965bf7c5b0b900ccd0e37d7e4e3dad3463dc..58fb9dbaf1d37d8785187244b0093bd723801d04 100644 (file)
@@ -3691,7 +3691,6 @@ declare
        v_query                         text;
        v_row                           record;
 begin
-       perform @NAMESPACE@.updateRelname(p_set_id, p_only_on_node);
        if p_only_on_node = -1 then
                return  @NAMESPACE@.createEvent('_@CLUSTERNAME@', 'DDL_SCRIPT', 
                        p_set_id::text, p_script::text, p_only_on_node::text);
@@ -3734,7 +3733,7 @@ begin
        -- Grab the central configuration lock
        -- ----
        lock table @NAMESPACE@.sl_config_lock;
-
+       perform @NAMESPACE@.updateRelname(p_set_id, p_only_on_node);
        -- ----
        -- Check that we either are the set origin or a current
        -- subscriber of the set.