mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Modify RelationFlushRelation so that if the relcache entry
has positive refcount, it is rebuilt from pg_class data. This ensures that relcache entries will track changes made by other backends. Formerly, a shared inval report would just be ignored if it happened to arrive while the relcache entry was in use. Also, fix relcache to reset ref counts to zero during transaction abort. Finally, change LockRelation() so that it checks for shared inval reports after obtaining the lock. In this way, once any kind of lock has been obtained on a rel, we can trust the relcache entry to be up-to-date.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: relcache.h,v 1.13 1999/07/15 23:04:23 momjian Exp $
|
||||
* $Id: relcache.h,v 1.14 1999/09/04 18:42:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -34,6 +34,8 @@ extern void RelationRegisterRelation(Relation relation);
|
||||
extern void RelationPurgeLocalRelation(bool xactComitted);
|
||||
extern void RelationInitialize(void);
|
||||
|
||||
extern void RelationCacheAbort(void);
|
||||
|
||||
/*
|
||||
* both vacuum.c and relcache.c need to know the name of the relcache init file
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user