{"record":{"id":"74b12516e31112fe","repo":"ankane/pgsync","slug":"usage-pgsync-options","errorCode":null,"errorMessage":"Usage:\n    pgsync [options]","messagePattern":"Usage:\n    pgsync \\[options\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/pgsync/sync.rb","lineNumber":27,"sourceCode":"\n    def perform\n      started_at = monotonic_time\n\n      args = @arguments\n      opts = @options\n\n      # only resolve commands from config, not CLI arguments\n      [:to, :from].each do |opt|\n        opts[opt] ||= resolve_source(config[opt.to_s])\n      end\n\n      # merge other config\n      [:to_safe, :exclude, :schemas].each do |opt|\n        opts[opt] ||= config[opt.to_s]\n      end\n\n      if args.size > 2\n        raise Error, \"Usage:\\n    pgsync [options]\"\n      end\n\n      raise Error, \"No source\" unless source.exists?\n      raise Error, \"No destination\" unless destination.exists?\n\n      unless opts[:to_safe] || destination.local?\n        raise Error, \"Danger! Add `to_safe: true` to `.pgsync.yml` if the destination is not localhost or 127.0.0.1\"\n      end\n\n      print_description(\"From\", source)\n      print_description(\"To\", destination)\n\n      if (opts[:preserve] || opts[:overwrite]) && destination.server_version_num < 90500\n        raise Error, \"Postgres 9.5+ is required for --preserve and --overwrite\"\n      end\n\n      resolver = TaskResolver.new(args: args, opts: opts, source: source, destination: destination, config: config, first_schema: first_schema)\n      tasks =","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/ankane/pgsync/blob/57bdddf5db506d329b51cb3376379dc3a2559010/lib/pgsync/sync.rb#L9-L45","documentation":"Error \"Usage:\n    pgsync [options]\" thrown in ankane/pgsync.","triggerScenarios":"Thrown at lib/pgsync/sync.rb:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57bdddf5db506d329b51cb3376379dc3a2559010","analyzedAt":"2026-08-23T11:18:48.887Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}