I wonder if instead of HAVE_SYSTEMD at each callsite we shouldn'tinstead have a pg_sd_notify() call that's a no-op when not systemd.
-- Álvaro Herrera http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services