Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package postgres

import (
	
	

	
	
	
)
DeletePseudoversionsExcept deletes all pseudoversions for the module except the provided resolvedVersion.
func ( *DB) ( context.Context, ,  string) ( error) {
	defer derrors.WrapStack(&, "DeletePseudoversionsExcept(ctx, db, %q, %q)", , )
	return .db.Transact(, sql.LevelDefault, func( *database.DB) error {
		const  = `
			DELETE FROM modules
			WHERE version_type = 'pseudo' AND module_path=$1 AND version != $2
			RETURNING version`
		,  := collectStrings(, , , , )
		if  != nil {
			return 
		}
		_,  = .Exec(, `DELETE FROM version_map WHERE module_path = $1 AND resolved_version = ANY($2)`,
			, pq.Array())
		return 
	})