Index: cluster.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/commands/cluster.c,v retrieving revision 1.82 retrieving revision 1.83 diff -c -r1.82 -r1.83 *** cluster.c 20 Jun 2002 20:29:26 -0000 1.82 --- cluster.c 12 Jul 2002 18:43:15 -0000 1.83 *************** *** 15,21 **** * * * IDENTIFICATION ! * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.82 2002/06/20 20:29:26 momjian Exp $ * *------------------------------------------------------------------------- */ --- 15,21 ---- * * * IDENTIFICATION ! * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.83 2002/07/12 18:43:15 tgl Exp $ * *------------------------------------------------------------------------- */ *************** *** 24,29 **** --- 24,30 ---- #include "access/genam.h" #include "access/heapam.h" + #include "catalog/dependency.h" #include "catalog/heap.h" #include "catalog/index.h" #include "catalog/pg_index.h" *************** *** 64,69 **** --- 65,71 ---- OldIndex; char NewHeapName[NAMEDATALEN]; char NewIndexName[NAMEDATALEN]; + ObjectAddress object; /* * We grab exclusive access to the target rel and index for the *************** *** 119,127 **** CommandCounterIncrement(); /* Destroy old heap (along with its index) and rename new. */ ! heap_drop_with_catalog(OIDOldHeap, allowSystemTableMods); ! CommandCounterIncrement(); renamerel(OIDNewHeap, oldrelation->relname); --- 121,134 ---- CommandCounterIncrement(); /* Destroy old heap (along with its index) and rename new. */ ! object.classId = RelOid_pg_class; ! object.objectId = OIDOldHeap; ! object.objectSubId = 0; ! /* XXX better to use DROP_CASCADE here? */ ! performDeletion(&object, DROP_RESTRICT); ! ! /* performDeletion does CommandCounterIncrement at end */ renamerel(OIDNewHeap, oldrelation->relname); *************** *** 198,203 **** --- 205,211 ---- OldIndex->rd_rel->relam, OldIndex->rd_index->indclass, OldIndex->rd_index->indisprimary, + false, /* XXX losing constraint status */ allowSystemTableMods); setRelhasindex(OIDNewHeap, true,