Обсуждение: pgsql: Modify the relcache to record the temp status of both local and
pgsql: Modify the relcache to record the temp status of both local and
От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message: ----------- Modify the relcache to record the temp status of both local and nonlocal temp relations; this is no more expensive than before, now that we have pg_class.relistemp. Insert tests into bufmgr.c to prevent attempting to fetch pages from nonlocal temp relations. This provides a low-level defense against bugs-of-omission allowing temp pages to be loaded into shared buffers, as in the contrib/pgstattuple problem reported by Stuart Bishop. While at it, tweak a bunch of places to use new relcache tests (instead of expensive probes into pg_namespace) to detect local or nonlocal temp tables. Modified Files: -------------- pgsql/src/backend/catalog: index.c (r1.314 -> r1.315) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c?r1=1.314&r2=1.315) namespace.c (r1.116 -> r1.117) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/namespace.c?r1=1.116&r2=1.117) toasting.c (r1.13 -> r1.14) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/toasting.c?r1=1.13&r2=1.14) pgsql/src/backend/commands: analyze.c (r1.134 -> r1.135) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/analyze.c?r1=1.134&r2=1.135) cluster.c (r1.182 -> r1.183) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/cluster.c?r1=1.182&r2=1.183) copy.c (r1.306 -> r1.307) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/copy.c?r1=1.306&r2=1.307) indexcmds.c (r1.182 -> r1.183) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/indexcmds.c?r1=1.182&r2=1.183) tablecmds.c (r1.280 -> r1.281) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.280&r2=1.281) vacuum.c (r1.386 -> r1.387) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c?r1=1.386&r2=1.387) pgsql/src/backend/optimizer/prep: prepunion.c (r1.167 -> r1.168) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.167&r2=1.168) pgsql/src/backend/postmaster: autovacuum.c (r1.93 -> r1.94) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/autovacuum.c?r1=1.93&r2=1.94) pgsql/src/backend/storage/buffer: bufmgr.c (r1.249 -> r1.250) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/buffer/bufmgr.c?r1=1.249&r2=1.250) pgsql/src/backend/utils/cache: relcache.c (r1.285 -> r1.286) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.285&r2=1.286) pgsql/src/include/utils: rel.h (r1.112 -> r1.113) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/rel.h?r1=1.112&r2=1.113)