ERROR: could not find pg_appendonly tuple for relation
search cancel

ERROR: could not find pg_appendonly tuple for relation

book

Article ID: 400410

calendar_today

Updated On:

Products

VMware Tanzu Data Suite VMware Tanzu Greenplum VMware Tanzu Greenplum / Gemfire

Issue/Introduction

ALTER TABLE fails with the following error:

# ALTER TABLE <schema>.<table> ...;
ERROR:  could not find pg_appendonly tuple for relation "<schema>.<table>"

 

Querying pg_class for the failing table shows blank reloptions does not have the "appendonly" option:

# \x on
# SELECT * FROM pg_class WHERE oid = '<schema>.<tablename>'::regclass 
   :
   :
 reloptions     | 
 

Environment

Greenplum Database 6.x

Cause

This issue is caused by a catalog (pg_appendonly) inconsistency affecting multiple tables, leading to this error which occurred during the attempt to alter the same tables.

The original condition that lead to the catalog inconsistency is believed to be caused by defect in an old release of Greenplum 6.x

The exposure to this error on the current release is due to the catalog is already incorrect. It was incorrectly updated while running the older version.

The fact that Greenplum was historically upgraded to a later release that is no more exposed to the original condition is not sufficient to avoid the error until the tables have been recreated.

Resolution

The recommended course of action would be to recreate the tables returned by the following SQL:

select * from pg_class
where relstorage in ('a', 'c')
 and reloptions is NULL
 or array_to_string(reloptions, ',') not like '%appendonly%';