ankane/pgsync · error · Error

Cannot use --overwrite with --in-batches

Error message

Cannot use --overwrite with --in-batches

What it means

Error "Cannot use --overwrite with --in-batches" thrown in ankane/pgsync.

Source

Thrown at lib/pgsync/client.rb:17

module PgSync
  class Client
    include Utils

    def initialize(args)
      @args = args
      output.sync = true
    end

    def perform
      result = Slop::Parser.new(slop_options).parse(@args)
      arguments = result.arguments
      options = result.to_h
      options[:defer_constraints_v2] ||= options[:defer_constraints]

      raise Error, "Specify either --db or --config, not both" if options[:db] && options[:config]
      raise Error, "Cannot use --overwrite with --in-batches" if options[:overwrite] && options[:in_batches]

      if options[:version]
        log VERSION
      elsif options[:help]
        log slop_options
      elsif options[:init]
        Init.new(arguments, options).perform
      else
        Sync.new(arguments, options).perform
      end
    rescue => e
      # Error, PG::ConnectionBad, Slop::Error
      raise e if options && options[:debug]
      abort colorize(e.message.strip, :red)
    end

    def self.start
      new(ARGV).perform

View on GitHub (pinned to 57bdddf5db)

When it happens

Trigger: Thrown at lib/pgsync/client.rb:17 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ankane/pgsync@57bdddf5db (2026-08-23). Data as JSON: /api/errors/4c20484151696664. Report an issue: GitHub.