PostgreSQL databases: console walkthrough¶
The same operations as the step-by-step guide, done in the console. See the overview for why the cluster belongs to your project.
This console page has a guided tour
Click Start the tour beside the create button for a walkthrough that highlights each field as you go.
List¶
WebHosting > Databases > PostgreSQL lists the databases in the selected project.
The Simple and Advanced views, the tour and the create button all sit on the page header, above the list.
The Applied column is the one to read: it reports whether the cluster actually has the database, rather than whether the object exists.
The page is project-scoped. While the project selector reads All Projects the list spans every project you can see and the create button is hidden.
Advanced hands off to the operator's own view, which shows every kind the PostgreSQL operator provides rather than the subset this page covers.
Create¶
Create PostgreSQL opens a guided form.
Configure via switches the same submission between the form and the YAML it produces.
Database Cluster¶
The clusters in your project, plus a Create new ... entry.
A project that already has a cluster starts on it, and one cluster is enough for many databases - there is rarely a reason to add a second.
A project with none starts on Create new ..., which reveals a name and a storage size. The defaults are fine for a first database.
The cluster is created in your own namespace
It is the cluster your project owns, created in your namespace when you save. There is no shared cluster to attach to instead.
Database name¶
Checked against the databases already on the cluster, so a clash is reported before you submit rather than after.
Database User¶
The login your application connects as. It fills in from the database name with a -user
suffix as you type, and stops following once you type your own.
The password is generated, not typed
It is never shown on screen. It goes into a Secret named after the database, and your workload should read it from there rather than carrying a copy.
This user is scoped to its own database and cannot create anything. The role that administers the cluster is separate, created once with the cluster, and is deliberately not offered here - see the two roles.
Use the YAML view toggle to see the Database object the form will submit. The cluster and the Secrets come from Templates, so the YAML view shows the database rather than the whole set.
Change¶
The console form creates; it does not edit. Rotating a password, growing the cluster's disk and adding further databases are all in Change.
The database name, its cluster and its owner cannot be changed after creation.
Delete¶
Use the kebab menu at the end of the row.
Deleting the database object may not drop the database
The reclaim policy defaults to keeping the data. See Delete for how to check, and why a retained database still occupies storage.
The user's Secret and its role on the cluster are separate objects and do not go with it either.
Where the console differs from the CLI¶
| Console | oc |
|
|---|---|---|
| Missing cluster | Create new ..., in the same submit | A policy creates one, or you run the cluster template |
| Storage size | Offered only when creating a cluster | -p STORAGE_SIZE on the cluster template |
| Database user | Prefilled from the database name | -p DB_USER, your choice |
| Passwords | Generated, never shown | Generated by the template |
| Name clashes | Checked as you type | Reported by the operator after apply |
Ambiguous Database kind |
Not a concern - the page targets one kind | Use databases.postgresql.cnpg.io |