]> granicus.if.org Git - postgresql/commit
Don't allow to disable backend assertions via the debug_assertions GUC.
authorAndres Freund <andres@anarazel.de>
Fri, 20 Jun 2014 09:06:42 +0000 (11:06 +0200)
committerAndres Freund <andres@anarazel.de>
Fri, 20 Jun 2014 09:09:17 +0000 (11:09 +0200)
commit3bdcf6a5a7555035810e2ba2b8a0fb04dc5c66b8
treeca974ea8843cb59f1ea8616f0f742e9faa5e8dbe
parent45b0f357235236dd3198f8abcca277adc0d7459a
Don't allow to disable backend assertions via the debug_assertions GUC.

The existance of the assert_enabled variable (backing the
debug_assertions GUC) reduced the amount of knowledge some static code
checkers (like coverity and various compilers) could infer from the
existance of the assertion. That could have been solved by optionally
removing the assertion_enabled variable from the Assert() et al macros
at compile time when some special macro is defined, but the resulting
complication doesn't seem to be worth the gain from having
debug_assertions. Recompiling is fast enough.

The debug_assertions GUC is still available, but readonly, as it's
useful when diagnosing problems. The commandline/client startup option
-A, which previously also allowed to enable/disable assertions, has
been removed as it doesn't serve a purpose anymore.

While at it, reduce code duplication in bufmgr.c and localbuf.c
assertions checking for spurious buffer pins. That code had to be
reindented anyway to cope with the assert_enabled removal.
14 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/ref/postgres-ref.sgml
src/backend/access/gin/ginpostinglist.c
src/backend/commands/event_trigger.c
src/backend/postmaster/postmaster.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/lmgr/proc.c
src/backend/tcop/postgres.c
src/backend/utils/cache/catcache.c
src/backend/utils/cache/relfilenodemap.c
src/backend/utils/misc/guc.c
src/include/c.h
src/include/postgres.h