Aller au contenu

PostgreSQL administration

The Administer button on a PostgreSQL card (chart/postgres) — visible once the application is Running, restricted to users with the admin role on the namespace.

PostgreSQL administration

The modal connects live to the application's database (no copy or cache on the Control Panel side) using the administrator account the chart created at deployment. Three tabs:

Databases

Lists existing databases (excluding technical ones) and lets you create a new one by name.

Users & rights

  • Create / reset a user: if it doesn't exist yet, it is created; if it already exists, its password is regenerated. The generated password is shown only once, right after the operation — Postgres never stores it in plaintext, so it can't be read back afterward. Note it down or copy it immediately.
  • Roles flagged System (streaming_replica, cnpg_metrics_exporter, and the administrator account the chart itself created) are technical platform roles: they don't appear in the Grant rights field, and their password can't be reset from this interface.
  • Clicking a user expands their current rights, database by database (screenshot above). The level shown is inferred from the privileges actually present on the public schema's tables — not from a history of grants: Access to the database means CONNECT was granted but no table exists yet (an ALTER DEFAULT PRIVILEGES waiting for a future table leaves no trace before it exists), and Custom rights means a set of privileges that doesn't match any of the three levels below (hand-edited through the Run SQL tab).
  • Grant rights applies a level — Read-only, Read-write or All rights — to a user on a database, including for objects created afterward (ALTER DEFAULT PRIVILEGES).

Run SQL

A free-form SQL command against the chosen database, with syntax highlighting. A SELECT returns a result table; any other command (DDL/DML) shows the status Postgres returns (e.g. CREATE TABLE, number of affected rows).

Warning

This tab runs any SQL command, including destructive ones (DROP TABLE, DELETE without a WHERE…). There is no intermediate confirmation: check the command and the selected database before running it.

Tip

There is no dedicated delete button for a database or a user: use the Run SQL tab instead (DROP DATABASE, or DROP OWNED BY followed by DROP ROLE for a user that was granted rights). A database can't be dropped while connected to it — select another database before running DROP DATABASE.