pg_dump: Dumping the contents of table “_hyper_3_833_chunk” failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR: missing chunk number 0 for toast value 10775681 in pg_toast_10749695
pg_dump: The command was: COPY _timescaledb_internal._hyper_3_833_chunk (request_time, request_id, widget_id, dashboard_id, username, query, result_size) TO stdout;
pg_dumpall: pg_dump failed on database “some_db”, exiting
vacuum full doesnt repair
INFO: vacuuming “_timescaledb_internal._hyper_3_833_chunk”
ERROR: missing chunk number 0 for toast value 10775681 in pg_toast_10749695
Hello @Pawel_S, here is a small function that can potentially help you to find the corrupted records:
CREATE OR REPLACE FUNCTION cache_read_corruption_check()
RETURNS bool LANGUAGE plpgsql AS $$
found_error bool = false;
FOR v_row IN SELECT * FROM cache_read order by 1 asc
perform length(v_row.bio); -- using the toast triggers the error
EXCEPTION WHEN internal_error OR data_corrupted OR index_corrupted THEN
RAISE NOTICE 'failed to work with the toast of id: % - %', v_row.id, v_row.ctid;
found_error = true;
It can probably help you to find the remaining records.
Recently I’ve have found another corrupted data and delete it.
Quering suspicious area of data without error
select * from cache_read where request_time > ‘2023-01-23 14:41:02.559 +0100’
backup has been successfuly created. It seems that issue was not related with timescaledb. Abut anyway thanks for help. Closing …