gizmodel/sql/catalog/gucs
PostgreSQL's configuration parameters, as pg_settings and SHOW ALL list them: the one owner of their names, boot values, units, limits and descriptions. A session's own values live in Conn.gucs.
import * as Gucs from "gizmodel/sql/catalog/gucs";Types
Guc
type Guc = { name: string; boot: string; unit: string; category: string; vartype: string; context: string; min: string; max: string; enumvals: string; desc: string; extra: string; }One parameter. boot is the value in the parameter's unit (as pg_settings.boot_val shows it).
name:stringboot:stringunit:stringcategory:stringvartype:stringcontext:stringmin:stringmax:stringenumvals:stringdesc:stringextra:string
Functions
parseNumber
function parseNumber(t: string): i64The digits of t as a number (other characters skipped).
Effects: fail.
hostSettingDenied
function hostSettingDenied(name: string): Option<DbError>The refusal (42501) of a statement that sets NAME, as the statement wrote it, when it is a host setting.
Effects: fail, alloc.
gucTable
function gucTable(): Vec<Guc>The parameters, in name order.
Effects: fail, alloc.
unitShown
function unitShown(value: string, unit: string): stringvalue (a number in the unit unit) as SHOW writes it: in the largest unit that divides it evenly (4096 kB: 4MB).
Effects: fail, alloc.
unitBase
function unitBase(text: string, unit: string): stringA value a user wrote (4MB, 5s, 1h, 100) in the unit unit of its parameter; the text itself when it has no number.
Effects: fail, alloc.
settingDefaults
function settingDefaults(): Vec<Vec<string>>Name and value of each parameter as SHOW ALL lists them.
Effects: fail, alloc.
Constants
HOST_SETTINGS
const HOST_SETTINGS = ["archive", "backups", "password"]The settings that name a server path or hold a secret: gizdb.archive, gizdb.backups, gizdb.password. Only the host sets them, as start options or, for a database of gizdb cluster, through its folder (cluster.giz hostSetting). A statement never does: SET, set_config, ALTER ROLE and ALTER DATABASE refuse them (hostSettingDenied).