summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2011-12-07 10:15:01 +0000
committerMarko Kreen2011-12-07 10:15:01 +0000
commit93c163de1ac95e4bf19972456e2a0ee90ab184a2 (patch)
tree583ac0cfaffc4296889aa507c39b8aa104d30a3b
parenta42d5d52c867da8c19980e81deb23299bf7df920 (diff)
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.
-rw-r--r--sql/londiste/functions/londiste.local_add_table.sql4
1 files 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;