Skip to main content

Module parameter

Module parameter 

Source
Expand description

Validated PostgreSQL configuration parameter names and values.

Recommended import style:

use pg_client::parameter;

let name = parameter::Name::from_static_or_panic("synchronous_commit");
let value = parameter::Value::from_static_or_panic("off");

These types model PG’s GUC (Grand Unified Configuration) parameters in every context where they apply: postgresql.conf, -c command-line flags, ALTER SYSTEM SET, ALTER DATABASE … SET, ALTER ROLE … SET, SET, SET LOCAL, and set_config(...). The pg_settings.context column on the PG side determines which of those targets a given parameter can be set through, but the name/value validity rules themselves are uniform.

See PG 18: Setting Parameters for upstream documentation. PG itself does not impose a documented byte length on string parameter values; the cap here is a sanity-check against programmer error, not a platform constraint.

Structs§

Name
Validated PostgreSQL configuration parameter name.
Value
Validated PostgreSQL configuration parameter value.

Enums§

NameError
ValueError

Constants§

VALUE_MAX_LEN
Maximum byte length of a validated PostgreSQL parameter value.

Type Aliases§

Map
Map of PostgreSQL configuration parameters.