Managed Service for PostgreSQL API, gRPC: UserService.Update
Updates the specified PostgreSQL user.
gRPC request
rpc Update (UpdateUserRequest) returns (operation.Operation)
UpdateUserRequest
{
"clusterId": "string",
"userName": "string",
"updateMask": "google.protobuf.FieldMask",
"password": "string",
"permissions": [
{
"databaseName": "string"
}
],
"connLimit": "int64",
"settings": {
"defaultTransactionIsolation": "TransactionIsolation",
"lockTimeout": "google.protobuf.Int64Value",
"logMinDurationStatement": "google.protobuf.Int64Value",
"synchronousCommit": "SynchronousCommit",
"tempFileLimit": "google.protobuf.Int64Value",
"logStatement": "LogStatement",
"poolMode": "PoolingMode",
"preparedStatementsPooling": "google.protobuf.BoolValue",
"catchupTimeout": "google.protobuf.Int64Value",
"walSenderTimeout": "google.protobuf.Int64Value",
"idleInTransactionSessionTimeout": "google.protobuf.Int64Value",
"statementTimeout": "google.protobuf.Int64Value",
"pgaudit": {
"log": [
"PGAuditSettingsLog"
]
}
},
"login": "google.protobuf.BoolValue",
"grants": [
"string"
],
"deletionProtection": "google.protobuf.BoolValue",
"userPasswordEncryption": "UserPasswordEncryption"
}
Field |
Description |
clusterId |
string Required field. ID of the PostgreSQL cluster the user belongs to. |
userName |
string Required field. Name of the user to be updated. |
updateMask |
Field mask that specifies which fields of the PostgreSQL User resource should be updated. |
password |
string New password for the user. |
permissions[] |
Set of permissions granted to the user to access specific databases. |
connLimit |
int64 Maximum number of database connections available to the user. When used in session pooling, this setting limits the number of connections to every single host in PostgreSQL cluster. In this case, the setting's value must be greater than the total number of connections that backend services can open to access the PostgreSQL cluster. The setting's value should not exceed the value of the [Cluster.config.postgresql_config.max_connections] setting. When used in transaction pooling, this setting limits the number of user's active transactions; therefore, in this mode user can open thousands of connections, but only Minimum value: |
settings |
|
login |
This flag defines whether the user can login to a PostgreSQL database. Default value: |
grants[] |
string A set of roles and privileges that are granted to the user. For more information, see the documentation. |
deletionProtection |
Deletion Protection inhibits deletion of the user Default value: |
userPasswordEncryption |
enum UserPasswordEncryption New password-based authentication method for user.
|
Permission
Field |
Description |
databaseName |
string Name of the database that the permission grants access to. |
UserSettings
PostgreSQL user settings.
Field |
Description |
defaultTransactionIsolation |
enum TransactionIsolation SQL sets an isolation level for each transaction. For more information, see the PostgreSQL documentation
|
lockTimeout |
The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. Default value: |
logMinDurationStatement |
This setting controls logging of the duration of statements. The duration of each completed statement will be logged if the statement ran for at least the specified amount of time (in milliseconds). Value of Value of For more information, see the PostgreSQL documentation |
synchronousCommit |
enum SynchronousCommit This setting defines whether DBMS will commit transaction in a synchronous way. When synchronization is enabled, cluster waits for the synchronous operations to be completed prior to reporting For more information, see the PostgreSQL documentation
|
tempFileLimit |
The maximum storage space size (in kilobytes) that a single process can use to create temporary files. A huge query may not fit into a server's RAM, therefore PostgreSQL will use some storage to store and execute such a query. Too big queries can make excessive use of the storage system, effectively making other quieries to run slow. This setting prevents execution of a big queries that can influence other queries by limiting size of temporary files. |
logStatement |
enum LogStatement This setting specifies which SQL statements should be logged (on the user level). For more information, see the PostgreSQL documentation
|
poolMode |
enum PoolingMode Mode that the connection pooler is working in with specified user. For more information, see the Odyssey documentation
|
preparedStatementsPooling |
User can use prepared statements with transaction pooling. For more information, see the PostgreSQL documentation |
catchupTimeout |
The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Default value: 0 Value of |
walSenderTimeout |
The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Default value: Value of For more information, see the PostgreSQL documentation |
idleInTransactionSessionTimeout |
Sets the maximum allowed idle time, in milliseconds, between queries while in a transaction. The default value is For more information, see the PostgreSQL documentation |
statementTimeout |
The maximum time (in milliseconds) to wait for statement. If Value of For more information, see the PostgreSQL documentation |
pgaudit |
Settings of the PostgreSQL Audit Extension |
PGAuditSettings
Field |
Description |
log[] |
enum PGAuditSettingsLog Defines which user queries will be written to the audit log. Corresponds to the Pg audit log user setting. The possible values are the following:
The default value is PG_AUDIT_SETTINGS_LOG_UNSPECIFIED. In this case, the parameter is not configured.
|
operation.Operation
{
"id": "string",
"description": "string",
"createdAt": "google.protobuf.Timestamp",
"createdBy": "string",
"modifiedAt": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"clusterId": "string",
"userName": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"name": "string",
"clusterId": "string",
"permissions": [
{
"databaseName": "string"
}
],
"connLimit": "int64",
"settings": {
"defaultTransactionIsolation": "TransactionIsolation",
"lockTimeout": "google.protobuf.Int64Value",
"logMinDurationStatement": "google.protobuf.Int64Value",
"synchronousCommit": "SynchronousCommit",
"tempFileLimit": "google.protobuf.Int64Value",
"logStatement": "LogStatement",
"poolMode": "PoolingMode",
"preparedStatementsPooling": "google.protobuf.BoolValue",
"catchupTimeout": "google.protobuf.Int64Value",
"walSenderTimeout": "google.protobuf.Int64Value",
"idleInTransactionSessionTimeout": "google.protobuf.Int64Value",
"statementTimeout": "google.protobuf.Int64Value",
"pgaudit": {
"log": [
"PGAuditSettingsLog"
]
}
},
"login": "google.protobuf.BoolValue",
"grants": [
"string"
],
"deletionProtection": "google.protobuf.BoolValue",
"userPasswordEncryption": "UserPasswordEncryption"
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
Creation timestamp. |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
The time when the Operation resource was last modified. |
done |
bool If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
UpdateUserMetadata
Field |
Description |
clusterId |
string ID of the PostgreSQL cluster the user belongs to. |
userName |
string Name of the user that is being updated. |
User
A PostgreSQL User resource. For more information, see
the Developer's Guide.
Field |
Description |
name |
string Name of the PostgreSQL user. |
clusterId |
string ID of the PostgreSQL cluster the user belongs to. |
permissions[] |
Set of permissions granted to the user to access specific databases. |
connLimit |
int64 Maximum number of database connections available to the user. When used in session pooling, this setting limits the number of connections to every single host in PostgreSQL cluster. In this case, the setting's value must be greater than the total number of connections that backend services can open to access the PostgreSQL cluster. The setting's value should not exceed the value of the Cluster.config.postgresqlConfig_12.effectiveConfig.maxConnections When used in transaction pooling, this setting limits the number of user's active transactions; therefore, in this mode user can open thousands of connections, but only Minimum value: |
settings |
|
login |
This flag defines whether the user can login to a PostgreSQL database. Default value: |
grants[] |
string A set of roles and privileges that are granted to the user. For more information, see the documentation. |
deletionProtection |
Determines whether the user deletion protection is enabled. The default value is |
userPasswordEncryption |
enum UserPasswordEncryption Password-based authentication method for user.
|
Permission
Field |
Description |
databaseName |
string Name of the database that the permission grants access to. |
UserSettings
PostgreSQL user settings.
Field |
Description |
defaultTransactionIsolation |
enum TransactionIsolation SQL sets an isolation level for each transaction. For more information, see the PostgreSQL documentation
|
lockTimeout |
The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. Default value: |
logMinDurationStatement |
This setting controls logging of the duration of statements. The duration of each completed statement will be logged if the statement ran for at least the specified amount of time (in milliseconds). Value of Value of For more information, see the PostgreSQL documentation |
synchronousCommit |
enum SynchronousCommit This setting defines whether DBMS will commit transaction in a synchronous way. When synchronization is enabled, cluster waits for the synchronous operations to be completed prior to reporting For more information, see the PostgreSQL documentation
|
tempFileLimit |
The maximum storage space size (in kilobytes) that a single process can use to create temporary files. A huge query may not fit into a server's RAM, therefore PostgreSQL will use some storage to store and execute such a query. Too big queries can make excessive use of the storage system, effectively making other quieries to run slow. This setting prevents execution of a big queries that can influence other queries by limiting size of temporary files. |
logStatement |
enum LogStatement This setting specifies which SQL statements should be logged (on the user level). For more information, see the PostgreSQL documentation
|
poolMode |
enum PoolingMode Mode that the connection pooler is working in with specified user. For more information, see the Odyssey documentation
|
preparedStatementsPooling |
User can use prepared statements with transaction pooling. For more information, see the PostgreSQL documentation |
catchupTimeout |
The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Default value: 0 Value of |
walSenderTimeout |
The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Default value: Value of For more information, see the PostgreSQL documentation |
idleInTransactionSessionTimeout |
Sets the maximum allowed idle time, in milliseconds, between queries while in a transaction. The default value is For more information, see the PostgreSQL documentation |
statementTimeout |
The maximum time (in milliseconds) to wait for statement. If Value of For more information, see the PostgreSQL documentation |
pgaudit |
Settings of the PostgreSQL Audit Extension |
PGAuditSettings
Field |
Description |
log[] |
enum PGAuditSettingsLog Defines which user queries will be written to the audit log. Corresponds to the Pg audit log user setting. The possible values are the following:
The default value is PG_AUDIT_SETTINGS_LOG_UNSPECIFIED. In this case, the parameter is not configured.
|