From 874b52d1ca6bb0375e823e9b26f248f592837bd0 Mon Sep 17 00:00:00 2001 From: Steve Singer Date: Tue, 15 Oct 2013 16:56:15 -0400 Subject: [PATCH 1/2] bug 320 - add the no_failed column to sl_node on an update functions The sl_node definition in 2.2.x has a no_failed boolean column we need to create this column on an update functions if it does not exist. --- src/backend/slony1_funcs.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/slony1_funcs.sql b/src/backend/slony1_funcs.sql index 5b3c4b4..d6a19a9 100644 --- a/src/backend/slony1_funcs.sql +++ b/src/backend/slony1_funcs.sql @@ -5371,6 +5371,10 @@ create table @NAMESPACE@.sl_components ( execute v_query; end if; + + + + if not exists (select 1 from information_schema.tables t where table_schema = '_@CLUSTERNAME@' and table_name = 'sl_event_lock') then v_query := 'create table @NAMESPACE@.sl_event_lock (dummy integer);'; execute v_query; @@ -5566,6 +5570,11 @@ create table @NAMESPACE@.sl_components ( where subs3.sub_receiver is null ); end if; + + if not @NAMESPACE@.check_table_field_exists('_@CLUSTERNAME@', 'sl_node', 'no_failed') then + alter table @NAMESPACE@.sl_node add column no_failed bool; + update @NAMESPACE@.sl_node set no_failed=false; + end if; return p_old; end; $$ language plpgsql; -- 1.7.10.4