Once you have set up the database you should avoid using the postgres superuser for managing access and running processes. Instead you log in as one of the database users defined during database setup.

The scheme file for using the database — as opposed to creating it — no longer needs information about the postgres database cluster. It only needs a project_path and user credentials for the database (user_project).

Scheme file structure

The minimal scheme file for process registration (and all other post-setup operations) looks like this:

{
  "project_path": "./xspatula",
  "user_project": {
    "user_name": "ini_cat_5_user",
    "password": "armchair-scouting-windowframe-bicycling"
  },
  "process": [
    {
      "execute": true,
      "verbose": 1,
      "overwrite": false,
      "delete": false
    }
  ]
}

The user_name and password refer to an ordinary database user (not a postgres pg_user). This user must have been inserted into the community.user table during database setup, and must have sufficient privileges — a stratum-5 user is recommended for setup operations.

Using a .netrc file

You can replace user_name and password with a user_netrc_id to store credentials in a .netrc file:

{
  "project_path": "./xspatula",
  "user_project": {
    "user_netrc_id": "xspatula"
  },
  "process": [
    {
      "execute": true,
      "verbose": 1,
      "overwrite": false,
      "delete": false
    }
  ]
}

The corresponding entry in ~/.netrc:

machine xspatula login ini_cat_5_user password armchair-scouting-windowframe-bicycling

The machine value is an arbitrary identifier you choose — the framework reads the login and password from the matching .netrc entry.

Key differences from the setup_db scheme file

Property setup_db scheme Post-setup scheme
postgresdb block Required (superuser, host, port, db name) Not present
user_project block Not present Required
db_users array Required (defines pg_users) Not present
User type Postgres superuser Ordinary database user

See the scheme file reference in the framework documentation for a full description of all scheme file options.

Input files

File Purpose
scheme_xspatula_local_use.json Example scheme file for post-setup operations; uses ini_cat_5_user with explicit password

Updated: