Make "provider remove" not fail if the table does not exist.
authorMarko Kreen <markokr@gmail.com>
Tue, 31 Jul 2007 14:27:18 +0000 (14:27 +0000)
committerMarko Kreen <markokr@gmail.com>
Tue, 31 Jul 2007 14:27:18 +0000 (14:27 +0000)
Patch by Dimitri Fontaine.

sql/londiste/functions/londiste.provider_remove_table.sql

index 6143bb2caf037f2689a046c47ab66add85debad3..8308459d8895796fe5f0fe13d004684b64ecc0bc 100644 (file)
@@ -17,7 +17,12 @@ begin
         raise exception 'no such table registered';
     end if;
 
-    execute 'drop trigger ' || tgname || ' on ' || i_table_name;
+    begin
+        execute 'drop trigger ' || tgname || ' on ' || i_table_name;
+    exception
+        when undefined_table then
+            raise notice 'table % does not exist', i_table_name;
+    end;
 
     delete from londiste.provider_table
         where queue_name = i_queue_name