{"record":{"id":"9733c2cd07909b1f","repo":"ankane/pgsync","slug":"postgres-9-5-is-required-for-preserve-and-ove","errorCode":null,"errorMessage":"Postgres 9.5+ is required for --preserve and --overwrite","messagePattern":"Postgres 9\\.5\\+ is required for --preserve and --overwrite","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/pgsync/sync.rb","lineNumber":41,"sourceCode":"        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 =\n        resolver.tasks.map do |task|\n          Task.new(source: source, destination: destination, config: config, table: task[:table], opts: opts.merge(sql: task[:sql]))\n        end\n\n      if opts[:in_batches] && tasks.size > 1\n        raise Error, \"Cannot use --in-batches with multiple tables\"\n      end\n\n      confirm_tables_exist(source, tasks, \"source\")\n\n      if opts[:list]\n        confirm_tables_exist(destination, tasks, \"destination\")\n        tasks.each do |task|\n          log task_name(task)","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/ankane/pgsync/blob/57bdddf5db506d329b51cb3376379dc3a2559010/lib/pgsync/sync.rb#L23-L59","documentation":"Error \"Postgres 9.5+ is required for --preserve and --overwrite\" thrown in ankane/pgsync.","triggerScenarios":"Thrown at lib/pgsync/sync.rb:41 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"}