Missing chunk number on a view?

From: Keaton Adams <kadams(at)mxlogic(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Missing chunk number on a view?
Date: 2008-06-11 18:39:53
Message-ID: C4757819.4455%kadams@mxlogic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I searched the archives and found references to the "missing chunk number 0 for toast value X" error and tried the suggestions, but can't seem to resolve this particular problem.

This is a test/QA system that uses an iSCSI disk array. Yesterday the array hiccupped and had to be rebooted while PostgreSQL was up and running. Now we are receiving the following error when running SQL against a particular view/table set:

Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-1] ERROR: unexpected chunk number 1 (expected 0) for toast value 84631845
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-2] STATEMENT: SELECT SUM(p.hits) - SUM(p.denied) AS cumm_allowed,
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-3] SUM(p.bytes_cs) AS cumm_bytes_cs,
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-4] SUM(p.bytes_sc) AS cumm_bytes_sc,
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-5] SUM(p.denied) AS cumm_denied,
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-6] CAST (FLOOR(EXTRACT (EPOCH FROM p.created - '2008-06-11 06:00:00Z'::timestamptz)) AS INT8) / 360
0 AS startiv
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-7] FROM kda_log_data AS p
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-8] WHERE p.id = 34781768
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-9] AND p.created >= '2008-06-11 06:00:00Z'::timestamptz
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-10] AND p.created < '2008-06-12 06:00:00Z'::timestamptz
Jun 11 08:18:45 mxlqa401 postgres[14176]: [1-11] GROUP BY CAST (FLOOR(EXTRACT (EPOCH FROM p.created - '2008-06-11 06:00:00Z'::timestamptz)) AS INT8) / 3600

The object kda_log_data is a view based on a series of selects against an entire table set joined by union statements.

When I attempt to drop the view I receive the following:

keaton=# drop view kda_log_data cascade;
ERROR: missing chunk number 0 for toast value 84631845

When I attempt to drop one of the underlying tables associated with the view I get:

keaton=# drop table kda_log_data_2006w40;
NOTICE: rule _RETURN on view kda_log_data depends on table kda_log_data_2006w40
NOTICE: view wds_log_data depends on rule _RETURN on view kda_log_data
ERROR: missing chunk number 0 for toast value 84631845

So I can't drop the view with the cascade option and I can't drop the underlying tables. I did copy out as much as the data as I could and my intention was to drop the view/tables, rebuild them and reload the data, but I can't seem to get past the "DROP VIEW/DROP TABLE" step.

I did try to do a pg_dump on the database and it blew up with the same "missing chunk number" error.

Suggestions?

Thanks,

Keaton

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma 2008-06-11 19:07:31 Re: [ODBC] what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE
Previous Message Adam Dear 2008-06-11 18:27:21 Re: Unable to dump database using pg_dump