> On Oct 6, 2021, at 10:16 AM, Peter Geoghegan <pg@bowt.ie> wrote:
>
> A return value of 0 cannot be said to indicate that the database is
> not corrupt;
Nor can a non-zero value be said to indicate that the database is corrupt.
These invocations will still return a non-zero exit status:
pg_amcheck -D no_privs_database
pg_amcheck --index="no_such_index"
pg_amcheck --table="somebody_elses_temp_table"
pg_amcheck --index="somebody_elses_temp_index"
but these have been modified to no longer do so:
pg_amcheck -D my_database_in_recovery --parent-check
pg_amcheck -D my_database_in_recovery --heapallindexed
pg_amcheck --all
Please compare to:
find /private || echo "FAIL"
rm /not/my/file || echo "FAIL"
I'm not sure how the idea that pg_amcheck should never give back a failure code unless there is corruption got inserted
intothis thread, but I'm not on board with that as an invariant statement. The differences in the upcoming version are
1) --all no longer means "all relations" but rather "all checkable relations"
2) checking options should be automatically downgraded under circumstances where they cannot be applied
3) unlogged relations during replication are by definition not corrupt
I think #1 and #3 are unsurprising enough that they need no documentation update. #2 is slightly surprising (at least
tome) so I updated the docs for it.
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company