]> granicus.if.org Git - postgresql/commit
From: Jan Wieck <jwieck@debis.com>
authorMarc G. Fournier <scrappy@hub.org>
Mon, 23 Feb 1998 17:44:24 +0000 (17:44 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Mon, 23 Feb 1998 17:44:24 +0000 (17:44 +0000)
commit6c7c6d0c05c3e9e8f9d4817ca761caf84ff50d54
treec834d2793eb6a5236d1127a22e791d6641bc0dca
parent9324d5cbe3e118059813a2bbd4ac826830f3653f
From: Jan Wieck <jwieck@debis.com>

    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().
src/backend/utils/cache/catcache.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/relcache.c
src/backend/utils/init/postinit.c
src/include/utils/catcache.h
src/include/utils/inval.h