Can anyone tell me what this error is? And How to resolve it?


could not read block 27651 in file "base/114689/118316": read only 4096 of 8192 bytes CONTEXT: SQL statement "SELECT fk."_ID" FROM ONLY "public"."table1" fk LEFT OUTER JOIN ONLY "public"."table2" pk ON ( pk."_ID"::pg_catalog.text OPERATOR(pg_catalog.=) fk."_ID"::pg_catalog.text) WHERE pk."_ID" IS NULL AND (fk."_ID" IS NOT NULL)"

  • 6
    Read and act on wiki.postgresql.org/wiki/Corruption now. Hopefully it's just a damaged index, but that should not happen either. Looks like a file is truncated. – Craig Ringer Jul 31 '15 at 11:51
  • Dear Craig, I am trying to migrate from mysql to postgres using python script. when i have used "DEFERRABLE INITIALLY DEFERRED" for index its restored properly with out any error. with the same dump when i tried with "" for index, its showing the above error. – Jeevitha Aug 3 '15 at 5:17
  • If you can cause that with only SQL commands then that is probably a bug. If you can provide full step by step instructions and input for causing it then please report it as a bug. Otherwise I will need more detail on the steps taken. – Craig Ringer Aug 3 '15 at 5:57
  • The following steps i am using to migrate from mysql to postgres. In step 4 DEFERRABLE INITIALLY DEFERRED is used. Instead of that if i removed those words and keep it empty i am getting the above error. please tell me whether it is mandatory or any other has to be replaced. – Jeevitha Aug 3 '15 at 7:03
  • 1. mysqldump --compatible=postgresql --default-character-set=utf8 -r db1.mysql -u root -p db1 2. python dbconverter.py db1.mysql db1.psql 3. psql -h localhost -d db1 -U test_user -W -f db1.psql 4. elif line.startswith("CONSTRAINT"): foreign_key_lines.append("ALTER TABLE \"%s\" ADD CONSTRAINT %s DEFERRABLE INITIALLY DEFERRED" % (current_table, line.split("CONSTRAINT")[1].strip().rstrip(",") – Jeevitha Aug 3 '15 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.