From 93c163de1ac95e4bf19972456e2a0ee90ab184a2 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 7 Dec 2011 12:15:01 +0200 Subject: [PATCH] londiste.local_add_table: ignore merge situation if copy is not needed This allows unsyncromized adding in different leafs, with --expect-sync. No reason to throw error in such case. --- sql/londiste/functions/londiste.local_add_table.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/londiste/functions/londiste.local_add_table.sql b/sql/londiste/functions/londiste.local_add_table.sql index 27a7c544..75d49ca0 100644 --- a/sql/londiste/functions/londiste.local_add_table.sql +++ b/sql/londiste/functions/londiste.local_add_table.sql @@ -263,7 +263,7 @@ begin loop -- if table from some other source is already marked as local, -- raise error - if _local then + if _local and coalesce(new_state, 'x') <> 'ok' then select 405, 'Found local table '|| _desc || ' in queue ' || _queue_name || ', use remove-table first to remove all previous ' @@ -274,7 +274,7 @@ begin -- when table comes from multiple sources, merge_all switch is -- required - if not _merge_all then + if not _merge_all and coalesce(new_state, 'x') <> 'ok' then select 405, 'Found multiple sources for table '|| _desc || ', use merge-all or no-merge to continue' into ret_code, ret_note; -- 2.39.5