Stop pretending that we'll ever work with another DBMS.
[mailshears.git] / lib / mv / plugins / agendav.rb
index 0324e6dc9e5003141ccf7ec6c8aacda1b3eb7130..ad1e9c2bfcf9f88b6fb67cf893a4c0ecb4d0348a 100644 (file)
@@ -21,25 +21,14 @@ class AgendavMv
     sql_queries << 'UPDATE shared SET user_from = $1 WHERE user_from = $2;'
     sql_queries << 'UPDATE shared SET user_which = $1 WHERE user_which = $2;'
 
     sql_queries << 'UPDATE shared SET user_from = $1 WHERE user_from = $2;'
     sql_queries << 'UPDATE shared SET user_which = $1 WHERE user_which = $2;'
 
-    begin
-      connection = PGconn.connect(@db_host,
-                                  @db_port,
-                                  @db_opts,
-                                  @db_tty,
-                                  @db_name,
-                                  @db_user,
-                                  @db_pass)
-
-      sql_queries.each do |sql_query|
-        connection.query(sql_query, [dst.to_s(), src.to_s()])
-      end
-
-      connection.close()
-
-    rescue PGError => e
-      # Pretend like we're database-agnostic in case we ever are.
-      raise DatabaseError.new(e)
+    connection = PGconn.connect(@db_host, @db_port, @db_opts, @db_tty,
+                                @db_name, @db_user, @db_pass)
+
+    sql_queries.each do |sql_query|
+      connection.query(sql_query, [dst.to_s(), src.to_s()])
     end
     end
+
+    connection.close()
   end
 
 end
   end
 
 end