Invent PGC_SU_BACKEND and mark log_connections/log_disconnections that way.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 14 Sep 2014 01:01:49 +0000 (21:01 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 14 Sep 2014 01:01:57 +0000 (21:01 -0400)
commitfe550b2ac249af5fbd8e9e19290a4ba43c882f2d
treef75803db65008b33b34fc69d92ba70dde3372814
parentc2a01439c04404ad8b271f788188c807a3de67d1
Invent PGC_SU_BACKEND and mark log_connections/log_disconnections that way.

This new GUC context option allows GUC parameters to have the combined
properties of PGC_BACKEND and PGC_SUSET, ie, they don't change after
session start and non-superusers can't change them.  This is a more
appropriate choice for log_connections and log_disconnections than their
previous context of PGC_BACKEND, because we don't want non-superusers
to be able to affect whether their sessions get logged.

Note: the behavior for log_connections is still a bit odd, in that when
a superuser attempts to set it from PGOPTIONS, the setting takes effect
but it's too late to enable or suppress connection startup logging.
It's debatable whether that's worth fixing, and in any case there is
a reasonable argument for PGC_SU_BACKEND to exist.

In passing, re-pgindent the files touched by this commit.

Fujii Masao, reviewed by Joe Conway and Amit Kapila
doc/src/sgml/config.sgml
src/backend/tcop/postgres.c
src/backend/utils/init/postinit.c
src/backend/utils/misc/guc.c
src/include/utils/guc.h