Question :
I found below errors in logs , Transaction stop logging in my database
2019-11-19 15:48:25 UTCERROR: could not open file "base/16384/16464.3" (target block 858400): No such file or directory
2019-11-19 15:48:25 UTCSTATEMENT: insert into jobqueue (jobtype,inum,params,submitted, nparam, sparam) values($1,$2,$3,$4,$5,$6)
2019-11-19 15:48:25 UTCERROR: could not open file "base/16384/16464.3" (target block 858467): No such file or directory
2019-11-19 15:48:25 UTCSTATEMENT: insert into jobqueue (jobtype,inum,params,submitted, nparam, sparam) values($1,$2,$3,$4,$5,$6)
2019-11-19 15:48:25 UTCERROR: index "sessionstates_pk" is not a btree
2019-11-19 15:48:25 UTCSTATEMENT: insert into sessionstates values ($1, $2, $3, $4, $5)
2019-11-19 15:48:25 UTCERROR: could not read block 381968 in file "base/16384/16464.2": read only 0 of 8192 bytes
2019-11-19 15:48:25 UTCSTATEMENT: insert into jobqueue (jobtype,inum,params,submitted, nparam, sparam) values($1,$2,$3,$4,$5,$6)
2019-11-19 15:48:25 UTCERROR: index "sessionstates_pk" is not a btree
2019-11-19 15:48:25 UTCSTATEMENT: insert into sessionstates values ($1, $2, $3, $4, $5)
Answer :
You are suffering from data corruption.
Perhaps someone deleted some files, perhaps your storage or file system isn’t reliable, perhaps there are hardware problems, perhaps you did something to the database that you shouldn’t have done.
In that case you should restore your last good backup.
But perhaps you are suffering from anti-virus software that randomly locks database files.
In that case you should keep the anti-virus software from accessing the PostgreSQL data directory.