Update PostgreSQL database name

This function renames a PostgreSQL® database.

Important:

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

Authorizations:
query Parameters
newname
required
string

The database's new name.

Note:

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.

Note:

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

Example: oldname=database

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  Postgresql \
  rename_database \
  oldname='database' \
  newname='database2'

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "rename_database",
  • "module": "Postgresql",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}