The following lists the various sections allowed in a configuration file and the items that are recognized by the Pyrseas utilities.
This section is used by the dbaugment utility (see dbaugment - Augment a database). Most of these are specified in the system configuration file delivered with Pyrseas, but can also be included or overriden in user or repository configuration files.
audit_columns: This section defines combinations of columns and triggers to be added to tables. Both columns and triggers are specified as YAML lists (to be consistent with dbtoyaml YAML output), although normally a single trigger will be necessary for column combination. The columns and triggers should reference previously defined items in the columns and triggers sections (see below). See Predefined Database Augmentations for audit columns defined in the system config.yaml.
columns: This section defines prototype columns to be added to a table by Augmenter. For each column, a valid Postgres data type should be included.
You can also add a not_null constraint and a default specification. See Predefined Database Augmentations for columns defined in the system config.yaml. In a repository or user configuration file, you can also specify an alternate name for a previously defined column. For example, if you prefer that the modified_timestamp columns be named last_update, you can add the following to a configuration file:
augmenter:
columns:
modified_timestamp:
name: last_update
function_templates: This section defines the source text for the trigger functions (see below) using a template language. Any text enclosed in double braces, e.g., {{modified_by_user}}, will be replaced, typically by a previously defined column or its alternate name (see above).
functions: This section defines prototype trigger functions to be invoked by audit columns or other augmentations. The following items can be specified for each function:
See Predefined Database Augmentations for functions defined in the system configuration file.
schema pyrseas: This section currently defines three functions that may be installed in the pyrseas schema if the full audit columns specifications is added for Augmenter processing.
schemas and tables: Multiple schema schema-name sections can be present, typically in a repository configuration file. Each such section can include table table-name items, and under each the audit_columns specifications to be added to the given table. For example:
augmenter:
schema public:
table t1:
audit_columns: default
triggers: This section defines the prototype triggers to be used with audit columns and other augmentations. The following items can be specified for each trigger:
This section is primarily for a user configuration file. If you frequently connect to a particular host, port or as a given user, that are not the Postgres defaults, adding corresponding entries to your user configuration file allows you to automatically override the defaults. If for a given invocation you need to connect to or as a different host, port or user, you can still override the configuration using the command line options (see Common Command Line Options):
This section is normally in a user or repository configuration file. It is used by dbtoyaml and yamltodb to determine which tables should be exported from or imported to the database. It consists of schema names, using the format schema schema_name, followed by lists of table names. For example:
datacopy:
schema public:
- t1
- t2
schema s1:
- t3
This section is used by all utilities (but dbaugment does not fully support it). The “repository” is intended to be a version control, e.g., Git, Mercurial, or Subversion, repository.