anchor.diff:            (read-benchmark-data file)
           (let ((mtime (simple-date:universal-time-to-timestamp (file-write-date file)))
                 (version-id (query (:select 'version-id :from 'versions :where
  -                                          (:and (:= 'implementation-name i-name) (:= 'version-number version)))
  -                                 :single)))
  +                                          (:and (:= 'implementation-name i-name)
  +                                                (:= 'version-number version)))
  +                                 :single!)))
             ;; First, make sure the benchmarks exist: Since we're in a txn,
             ;; we make one savepoint per benchmark and roll back if a benchmark
             ;; already exists.
  
positive.code:                 (declare (ignore r-secs ignore u-secs))
                  (ignore-errors
                    (with-savepoint one-bm
                      (query "insert into benchmarks (benchmark_name) values ('~A')" b-name)))))
              ;; Now insert the actual benchmark data
              (dolist (b benchmark)
                (destructuring-bind (b-name r-secs u-secs &rest ignore) b
  
negative.code:       (query statement))))
  
  (defun import-release-from-dir (impl dir)
    (setf (impl-version impl) (or (impl-version impl)
                                  (version-from-directory impl dir)))
    (with-db-connection ()
      (with-transaction (insert-release)
        (handler-case
            (with-savepoint one-implementation
              (query (:insert-into 'implementations :set
                                   'implementation-name (impl-name impl)
                                   'mode (prin1-to-string (impl-mode impl))
                                   'machine-name (machine-instance))))
          (cl-postgres-error:unique-violation ()
            nil))
        (let ((version-id nil))
          (handler-case
              (with-savepoint make-version
                (setf version-id
                      (query (:insert-into 'versions :set
                                           'implementation-name (impl-name impl) 'version-number (impl-version impl)
                                           'release-date (implementation-release-date impl dir)
                                           'is-release (release-p impl)
                                           'belongs-to-release (release-for-version impl)
                                           'version-code (or (implementation-version-code impl dir)
                                                             :null)
                                           :returning 'version-id)
                             :single)))
            (cl-postgres-error:unique-violation ()
              (with-savepoint get-version
                (setf version-id
                      (query (:select 'version-id :from 'versions
                                      :where (:and (:= 'implementation-name
                                                       (impl-name impl))
                                                   (:= 'version-number
                                                       (impl-version impl))))
                             :single)))))
          (assert (not (null version-id)))
          (handler-case
              (with-savepoint one-build
                (query (:insert-into 'builds :set
                                     'version-id version-id
                                     'mode (implementation-translated-mode impl))))
            (cl-postgres-error:unique-violation ()
              nil))))))
  
  (defun process-benchmark-data (&optional (dir *base-result-dir*)
                                 (machine-name (machine-instance)))
  