ankane/pgsync · error · Error

Usage: pgsync [options]

Error message

Usage:
    pgsync [options]

What it means

Error "Usage: pgsync [options]" thrown in ankane/pgsync.

Source

Thrown at lib/pgsync/sync.rb:27

    def perform
      started_at = monotonic_time

      args = @arguments
      opts = @options

      # only resolve commands from config, not CLI arguments
      [:to, :from].each do |opt|
        opts[opt] ||= resolve_source(config[opt.to_s])
      end

      # merge other config
      [:to_safe, :exclude, :schemas].each do |opt|
        opts[opt] ||= config[opt.to_s]
      end

      if args.size > 2
        raise Error, "Usage:\n    pgsync [options]"
      end

      raise Error, "No source" unless source.exists?
      raise Error, "No destination" unless destination.exists?

      unless opts[:to_safe] || destination.local?
        raise Error, "Danger! Add `to_safe: true` to `.pgsync.yml` if the destination is not localhost or 127.0.0.1"
      end

      print_description("From", source)
      print_description("To", destination)

      if (opts[:preserve] || opts[:overwrite]) && destination.server_version_num < 90500
        raise Error, "Postgres 9.5+ is required for --preserve and --overwrite"
      end

      resolver = TaskResolver.new(args: args, opts: opts, source: source, destination: destination, config: config, first_schema: first_schema)
      tasks =

View on GitHub (pinned to 57bdddf5db)

When it happens

Trigger: Thrown at lib/pgsync/sync.rb:27 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/74b12516e31112fe. Report an issue: GitHub.