Info

This page contains tools I wrote for the PostgreSQL database server.

system

Description

The system schema contains functions and tables for restarting the database server and maintaining the hba and ident file within the database itself. So you could reload the server from your psql client session without using the shell or any init scripts.

Synopsis

Functions
system.reload()reloads the databases server (sends SIGHUP to the main process)
system.smart_shutdown(),
system.fast_shutdown(),
system.immediate_shutdown()
equivalents to pg_ctl with shutdown mode smart, fast and immediate, respectively
system.smart_restart(),
system.fast_restart(),
system.immediate_restart()
equivalents to pg_ctl with restart mode smart, fast and immediate, respectively
system.incarnation()how many times the database has been restarted by calling system.*_restart()
system.exists_database(NAME)returns true if the named database exists in pg_database (internal helper for table constraint)
system.exists_user(NAME)returns true if the named user exists in pg_user (internal helper for table constraint)
system.exists_ident(NAME)returns true if the named ident map exists in system.ident (see below)
Tables
system.hbathe equivalent of pg_hba.conf; every update to this table updates pg_hba.conf, too
system.identthe equivalent of pg_ident.conf; every update to this table updates pg_ident.conf, too

Installation