cPanel WHM icon

cPanel WHM

Full cPanel WHM API — all 622 operations across Accounts, DNS, Mail, SSL, Backups, Databases and more

Actions262

Database → Update PostgreSQL database name

AI-generated

Summary

Rename an existing PostgreSQL database within a cPanel account by specifying its current name and the desired new name. Optionally provide the database owner's username if needed.

Inputs

  • Oldname (required) — The current name of the PostgreSQL database to rename.
  • Newname (required) — The new name for the PostgreSQL database. If database prefixing is enabled, this must include the database prefix for the account.
  • Cpuser — The database owner's username, used to specify the owner of the database.

Output shape

a single JSON object with the operation result from the WHM API

The response includes the status and any relevant data or error messages returned from the WHM API after attempting to rename the PostgreSQL database.

Examples

Example 1: Rename a PostgreSQL database named 'old_db' to 'new_db' for a cPanel user 'cpuser1'.

Set Oldname to 'old_db', Newname to 'new_db', and Cpuser to 'cpuser1'.

Links

Discussion