Update PostgreSQL username without password

This function renames a PostgreSQL® database user.

Warning:

  • If you rename a PostgreSQL user, you must set the password for the database user. This is required because of the md5 hash that PostgreSQL creates to store user passwords.
  • We strongly recommend that you use the Postgresql::rename_user function instead of this one.

Important:

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

SecurityBasicAuth
Request
query Parameters
newname
required
string

The database user's new name.

Note:

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

Example: newname=dbuser2
oldname
required
string

The database user's current name.

Note:

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

Example: oldname=dbuser
Responses
200

HTTP Request was successful.

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
get/Postgresql/rename_user_no_password
Request samples
uapi --output=jsonpretty \
  --user=username \
  Postgresql \
  rename_user_no_password \
  oldname='dbuser' \
  newname='dbuser2'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "rename_user_no_password",
  • "module": "Postgresql",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}