{"record":{"id":"4565ad197fbcf417","repo":"ankane/pgsync","slug":"pg-restore-not-found","errorCode":null,"errorMessage":"pg_restore not found","messagePattern":"pg_restore not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/pgsync/schema_sync.rb","lineNumber":75,"sourceCode":"    private\n\n    def run_command(dump_command, restore_command)\n      err_r, err_w = IO.pipe\n      Open3.pipeline_start(dump_command, restore_command, err: err_w) do |wait_thrs|\n        err_w.close\n        err_r.each do |line|\n          yield line\n        end\n        wait_thrs.all? { |t| t.value.success? }\n      end\n    end\n\n    # --if-exists introduced in Postgres 9.4\n    # not ideal, but simpler than trying to parse version\n    def supports_if_exists?\n      `pg_restore --help`.include?(\"--if-exists\")\n    rescue Errno::ENOENT\n      raise Error, \"pg_restore not found\"\n    end\n\n    def dump_command\n      cmd = [\"pg_dump\", \"-Fc\", \"--verbose\", \"--schema-only\", \"--no-owner\", \"--no-acl\"]\n      if specify_tables?\n        @tasks.each do |task|\n          cmd.concat([\"-t\", task.quoted_table])\n        end\n      end\n      cmd.concat([\"-d\", @source.url])\n    end\n\n    def restore_command\n      cmd = [\"pg_restore\", \"--verbose\", \"--no-owner\", \"--no-acl\", \"--clean\"]\n      cmd << \"--if-exists\" if supports_if_exists?\n      cmd.concat([\"-d\", @destination.url])\n    end\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/ankane/pgsync/blob/57bdddf5db506d329b51cb3376379dc3a2559010/lib/pgsync/schema_sync.rb#L57-L93","documentation":"Error \"pg_restore not found\" thrown in ankane/pgsync.","triggerScenarios":"Thrown at lib/pgsync/schema_sync.rb:75 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"}