Postgres Facts

See also: Postgres Operations.

postgres.PostgresDatabases

host.get_fact(PostgresDatabases, psql_user=None, psql_password=None, psql_host=None, psql_port=None)

Returns a dict of PostgreSQL databases and metadata:

{
    "pyinfra_stuff": {
        "encoding": "UTF8",
        "collate": "en_US.UTF-8",
        "ctype": "en_US.UTF-8",
        ...
    },
}

postgres.PostgresRoles

host.get_fact(PostgresRoles, psql_user=None, psql_password=None, psql_host=None, psql_port=None)

Returns a dict of PostgreSQL roles and data:

{
    "pyinfra": {
        "super": true,
        "createrole": false,
        "createdb": false,
        ...
    },
}