diff options
| author | Tom Lane | 2002-09-22 20:56:28 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-09-22 20:56:28 +0000 |
| commit | 3503f19eeb812d7d7bbc25de25376c3a46f52257 (patch) | |
| tree | 0ee406d92d267195ad1bfada4452280bebc6c051 /src | |
| parent | 286fb25243724d0b4bdb4ed06af250f34779db4a (diff) | |
RelationClearRelation must reset rd_targblock and update rd_nblocks
even when dealing with a nailed-in-cache relation; otherwise, following
VACUUM truncation of a system catalog, other backends might have
unreasonably large values of these fields.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/utils/cache/relcache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index a0eeff11dd3..ac80fba519a 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.175 2002/09/04 20:31:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.176 2002/09/22 20:56:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1685,10 +1685,14 @@ RelationClearRelation(Relation relation, bool rebuild) /* * Never, never ever blow away a nailed-in system relation, because - * we'd be unable to recover. + * we'd be unable to recover. However, we must update rd_nblocks + * and reset rd_targblock, in case we got called because of a relation + * cache flush that was triggered by VACUUM. */ if (relation->rd_isnailed) { + relation->rd_targblock = InvalidBlockNumber; + RelationUpdateNumberOfBlocks(relation); #ifdef ENABLE_REINDEX_NAILED_RELATIONS RelationReloadClassinfo(relation); #endif /* ENABLE_REINDEX_NAILED_RELATIONS */ |
