postgresql/contrib/pg_visibility
Tom Lane f10f0ae420 Replace RelationOpenSmgr() with RelationGetSmgr().
The idea behind this patch is to design out bugs like the one fixed
by commit 9d523119f.  Previously, once one did RelationOpenSmgr(rel),
it was considered okay to access rel->rd_smgr directly for some
not-very-clear interval.  But since that pointer will be cleared by
relcache flushes, we had bugs arising from overreliance on a previous
RelationOpenSmgr call still being effective.

Now, very little code except that in rel.h and relcache.c should ever
touch the rd_smgr field directly.  The normal coding rule is to use
RelationGetSmgr(rel) and not expect the result to be valid for longer
than one smgr function call.  There are a couple of places where using
the function every single time seemed like overkill, but they are now
annotated with large warning comments.

Amul Sul, after an idea of mine.

Discussion: https://postgr.es/m/CANiYTQsU7yMFpQYnv=BrcRVqK_3U3mtAzAsJCaqtzsDHfsUbdQ@mail.gmail.com
2021-07-12 17:01:36 -04:00
..
expected Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
sql Disable vacuum page skipping in selected test cases. 2021-01-20 11:49:29 -05:00
.gitignore Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
pg_visibility--1.0--1.1.sql pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
pg_visibility--1.1--1.2.sql Default monitoring roles 2017-03-30 14:18:53 -04:00
pg_visibility--1.1.sql pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
pg_visibility.c Replace RelationOpenSmgr() with RelationGetSmgr(). 2021-07-12 17:01:36 -04:00
pg_visibility.control Default monitoring roles 2017-03-30 14:18:53 -04:00