1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00
The diff looks so simple and easy. But to find it wasn't fun.

    It must have been there for a long time. What happened:

    When a tuple in one of some central catalogs was updated, the
    referenced  relation  got flushed, so it would be reopened on
    the next access (to reflect new  triggers,  rules  and  table
    structure changes into the relation cache).

    Some  data  (the  tupleDescriptor e.g.) is used in the system
    cache too. So when a relation is subject to the system cache,
    this  must know too that a cached system relation got flushed
    because the tupleDesc data gets freed during the flush!

    For the GRANT/REVOKE on pg_class it was  slightly  different.
    There  is some local data in inval.c that gets initialized on
    the first invalidation of a tuple in some  central  catalogs.
    This  needs a SysCache lookup in pg_class. But when the first
    of all commands is a GRANT on pg_class,  exactly  the  needed
    tuple is the one actually invalidated. So I added little code
    snippets that the initialization of the  local  variables  in
    inval.c will already happen during InitPostgres().
This commit is contained in:
Marc G. Fournier
1998-02-23 17:44:24 +00:00
parent 9324d5cbe3
commit 6c7c6d0c05
6 changed files with 55 additions and 6 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.9 1997/11/17 16:59:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.10 1998/02/23 17:43:23 scrappy Exp $
*
* Note - this code is real crufty...
*
@ -512,6 +512,20 @@ RelationInvalidateRelationCache(Relation relation,
(*function) (relationId, objectId);
}
/*
* InitLocalInvalidateData
*
* Setup this before anything could ever get invalid!
* Called by InitPostgres();
*/
void
InitLocalInvalidateData()
{
ValidateHacks();
}
/*
* DiscardInvalid --
* Causes the invalidated cache state to be discarded.