Update PostgreSQL database name

This function changes a PostgreSQL® database's name.

Warning:

The system requires more time to rename larger and more complex databases.

Important:

When you disable the PostgreSQL role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
newname
required
string

The database's new name.

Warning: If database prefixing is enabled, this parameter must include the database prefix for the account.

Example: newname=database2
oldname
required
string

The database's current name.

Example: oldname=database
cpuser
string <username>

The database's owner.

Example: cpuser=username
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/rename_postgresql_database
Request samples
whmapi1 --output=jsonpretty \
  rename_postgresql_database \
  oldname='database' \
  newname='database2'
Response samples
application/json
{
  • "metadata": {
    • "command": "rename_postgresql_database",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}