Reputation: 1103
I am getting the following error on a particular id
, when I try to do TestModel.find_each
everytime. Even though I am able to access that object by find
. and on deleting that particular object, this same error with the same oid(16385) and index(19388) is occurring for the just next id. Why is this happening?
PG::UndefinedFile at / ERROR: could not open file "base/16385/19338.2" (target block 268441506): No such file or directory
Upvotes: 1
Views: 2833
Reputation: 61506
This is unrelated to rails
, it's a postgres
message indicating that a datafile is missing.
16385
is the identifier (OID) of the database, 19338
the relation
in PG terms (an index or a table).
You may question why a datafile disappeared from PostgreSQL data directory, this should never happen.
The advice in this case is to restore the entire database from a backup.
Maybe you'll see more errors or errors in context in the postgresql log files.
Upvotes: 4