Skip to content

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 code ik-dockr-img gives the PG User acme_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.

PG User and PGDATABASE built from the code ik-dockr-img, on the App Server's Database tab

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 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.