Stop pretending that we'll ever work with another DBMS.
[mailshears.git] / lib / mv / plugins / postfixadmin.rb
index 338be052f63affe1bb8deab2041cd994994cfbb6..659b9b7d7166f98d2974cdc53159098cc9a9e8af 100644 (file)
@@ -39,30 +39,18 @@ class PostfixadminMv
 
     sql_queries = [mailbox_query, alias_query1, alias_query2]
 
-    begin
-      connection = PGconn.connect(@db_host,
-                                  @db_port,
-                                  @db_opts,
-                                  @db_tty,
-                                  @db_name,
-                                  @db_user,
-                                  @db_pass)
-
-      sql_queries.each do |sql_query|
-          varchar = 1043 # from pg_type.h
-          params = [{:value => dst.to_s(), :type => varchar},
-                    {:value => dst.domainpart(), :type => varchar},
-                    {:value => dst.localpart(), :type => varchar},
-                    {:value => src.to_s(), :type => varchar}]
-        connection.query(sql_query, params)
-      end
-
-      connection.close()
-
-    rescue PGError => e
-      # Pretend like we're database-agnostic in case we ever are.
-      raise DatabaseError.new(e)
-    end
+    connection = PGconn.connect(@db_host, @db_port, @db_opts, @db_tty,
+                                @db_name, @db_user, @db_pass)
+
+    sql_queries.each do |sql_query|
+        varchar = 1043 # from pg_type.h
+        params = [{:value => dst.to_s(), :type => varchar},
+                  {:value => dst.domainpart(), :type => varchar},
+                  {:value => dst.localpart(), :type => varchar},
+        {:value => src.to_s(), :type => varchar}]
+
+    connection.query(sql_query, params)
+    connection.close()
   end