|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.175 2002/09/04 20:31:30 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.176 2002/09/22 20:56:28 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1685,10 +1685,14 @@ RelationClearRelation(Relation relation, bool rebuild)
|
1685 | 1685 |
|
1686 | 1686 | /*
|
1687 | 1687 | * Never, never ever blow away a nailed-in system relation, because
|
1688 |
| - * we'd be unable to recover. |
| 1688 | + * we'd be unable to recover. However, we must update rd_nblocks |
| 1689 | + * and reset rd_targblock, in case we got called because of a relation |
| 1690 | + * cache flush that was triggered by VACUUM. |
1689 | 1691 | */
|
1690 | 1692 | if (relation->rd_isnailed)
|
1691 | 1693 | {
|
| 1694 | +relation->rd_targblock=InvalidBlockNumber; |
| 1695 | +RelationUpdateNumberOfBlocks(relation); |
1692 | 1696 | #ifdefENABLE_REINDEX_NAILED_RELATIONS
|
1693 | 1697 | RelationReloadClassinfo(relation);
|
1694 | 1698 | #endif/* ENABLE_REINDEX_NAILED_RELATIONS */
|
|