             opts.query += " (#{fields.join(', ')}) VALUES (#{values.join(', ')}) "
 
         if opts.set?
-            fields = []
-            values = []
-            for field, param of opts.values
+            v = []
+            for field, param of opts.set
                 if field.indexOf('::') != -1
                     [field, type] = field.split('::')
                     type = type.trim()
                     v.push("#{field.trim()}=$#{push_param(param, type)}::#{type}")
                     continue
                 else
-                    fields.push(field)
-                    values.push("$#{push_param(param)}")
-
-            opts.query += " SET  (#{fields.join(', ')}) VALUES (#{values.join(', ')}) "
+                    v.push("#{field.trim()}=$#{push_param(param)}")
+            if v.length > 0
+                opts.query += " SET #{v.join(', ')} "
 
         if opts.conflict?
             if not opts.values?

            where     : undefined    # Used for SELECT: If given, must be a map with keys clauses with $::TYPE  (not $1::TYPE!)
                                     # and values the corresponding params.  Also, WHERE must not be in the query already.
                                     # If where[cond] is undefined, then cond is completely **ignored**.
            values    : undefined    # Used for INSERT: If given, then params and where must not be given.   Values is a map
                                     # {'field1::type1':value, , 'field2::type2':value2, ...} which gets converted to
                                     # ' (field1, field2, ...) VALUES ($1::type1, $2::type2, ...) '

        @_query
            query : 'UPDATE accounts'
            set   :
                'creation_actions_done::BOOLEAN' : true
            where :
                'account_id = $::UUID' : opts.account_id
            cb     : opts.cb

    do_account_creation_actions: (opts) =>
