{"record":{"id":"18f2f241e13d9f0b","repo":"ankane/pgsync","slug":"sync-failed-for-failed-tables-size-table-faile","errorCode":null,"errorMessage":"Sync failed for #{failed_tables.size} table#{failed_tables.size == 1 ? nil : \"s\"}: #{failed_tables.join(\", \")}","messagePattern":"Sync failed for #(.+?) table#(.+?): #(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/pgsync/table_sync.rb","lineNumber":310,"sourceCode":"          # we only update NOT DEFERRABLE\n          # https://www.postgresql.org/docs/current/sql-set-constraints.html\n          if opts[:defer_constraints_v2]\n            destination.execute(\"SET CONSTRAINTS ALL IMMEDIATE\")\n\n            table_constraints.each do |table, constraints|\n              constraints.each do |constraint|\n                destination.execute(\"ALTER TABLE #{quote_ident_full(table)} ALTER CONSTRAINT #{quote_ident(constraint)} NOT DEFERRABLE\")\n              end\n            end\n          end\n        end\n      else\n        yield\n      end\n    end\n\n    def fail_sync(failed_tables)\n      raise Error, \"Sync failed for #{failed_tables.size} table#{failed_tables.size == 1 ? nil : \"s\"}: #{failed_tables.join(\", \")}\"\n    end\n\n    def display_item(item)\n      messages = []\n      messages << task_name(item)\n      messages << item.opts[:sql] if item.opts[:sql]\n      messages.join(\" \")\n    end\n\n    def windows?\n      Gem.win_platform?\n    end\n  end\nend\n","sourceCodeStart":292,"sourceCodeEnd":325,"githubUrl":"https://github.com/ankane/pgsync/blob/57bdddf5db506d329b51cb3376379dc3a2559010/lib/pgsync/table_sync.rb#L292-L325","documentation":"Error \"Sync failed for #{failed_tables.size} table#{failed_tables.size == 1 ? nil : \"s\"}: #{failed_tables.join(\", \")}\" thrown in ankane/pgsync.","triggerScenarios":"Thrown at lib/pgsync/table_sync.rb:310 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"}