Postgresql
14 functions, invoked through the cpanel_uapi tool.
cpanel_uapi(service_id, module="Postgresql", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.create_database GET#
Create PostgreSQL database
This function creates a PostgreSQL® database.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
create_user GET#
Create PostgreSQL user
This function creates a PostgreSQL® database user.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
delete_database GET#
Delete PostgreSQL database
This function deletes a PostgreSQL® database.
Important:
When you disable the Postgres role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
delete_user GET#
Delete PostgreSQL user
This function deletes a PostgreSQL® user.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
get_restrictions GET#
Return PostgreSQL name length restrictions
This function retrieves the PostgreSQL® user and database name length restrictions.
Important:
When you disable the PostgreSQL role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
grant_all_privileges GET#
Enable all user privileges on PostgreSQL database
This function grants all privileges for a PostgreSQL® database to a database user.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
list_databases GET#
Return PostgreSQL databases
This function lists an account's PostgreSQL® databases.
Important:
When you disable the Postgres role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
list_users GET#
Return PostgreSQL users
This function lists an account's PostgreSQL® database users.
Important:
When you disable the PostgreSQL role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
An array of strings which are PostgreSQL database usernames.
rename_database GET#
Update PostgreSQL database name
This function renames a PostgreSQL® database.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
rename_user GET#
Update PostgreSQL username
This function renames a PostgreSQL® database user.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
rename_user_no_password GET#
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.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
revoke_all_privileges GET#
Remove PostgreSQL user privileges
This function revokes all privileges for a PostgreSQL® database from a database user.
Important:
When you disable the PostgreSQL role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
set_password GET#
Update PostgreSQL user password
This function changes a PostgreSQL® database user's password.
Important:
When you disable the Postgres role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
update_privileges GET#
Update PostgreSQL® privileges
This function synchronizes PostgreSQL® database user privileges on an account.
Some versions of PostgreSQL are ANSI SQL-92 compliant and do not support recursive grants, wildcard grants, or future grants. If you use phpPgAdmin, or manually create new tables, and you want multiple PostgreSQL users to access your PostgreSQL tables, you may either call this API function or click _Synchronize Grants_ in the _PostgreSQL Databases_ interface (_Home >> Databases >> PostgreSQL Databases_) after you add a table.
Important:
When you disable the PostgreSQL role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.