Role and Database Names¶
Muppy writes PostgreSQL role and database names as they are, without quotes, in every statement
it runs: CREATE ROLE, CREATE DATABASE, GRANT, pg_dump. PostgreSQL accepts such a name only
when it:
- starts with a lowercase letter or
_; - holds only lowercase letters, digits and
_; - is 63 characters at most.
App Server names¶
An App Server gets its PG User and its PGDATABASE from its customer slug, code, version and id (Database tab). Muppy turns them into valid names:
- a character outside the rule becomes
_: the codeik-dockr-imggives the PG Useracme_ik_dockr_img_8xl; - capitals become lowercase, and accents are dropped;
- a name too long is cut and ends with
_and 8 characters that keep it unique. The PG User stops at 59 characters, so that PGDATABASE,<PG User>_001, fits too.
The same applies when you set the PG User Prefix or PG User Suffix yourself.
Written through the API, a PG User or a PGDATABASE outside the rule is refused, and the error proposes the corrected name.
Roles Muppy creates, databases it shares¶
Before any statement, Muppy refuses a name outside the rule for:
- a role it creates: an App Server's PG User, the replication user of a Replicated Cluster Set, the pglookout user;
- the database, the role and the owner of a shared database.
A role name with capitals is created in lowercase, as PostgreSQL does for an unquoted name. Muppy creates each role on the cluster it belongs to, also on a Host that carries several clusters.
