Managed Service for PostgreSQL API, gRPC: UserService
A set of methods for managing PostgreSQL User resources.
Call | Description |
---|---|
Get | Returns the specified PostgreSQL User resource. |
List | Retrieves the list of PostgreSQL User resources in the specified cluster. |
Create | Creates a PostgreSQL user in the specified cluster. |
Update | Updates the specified PostgreSQL user. |
Delete | Deletes the specified PostgreSQL user. |
GrantPermission | Grants permission to the specified PostgreSQL user. |
RevokePermission | Revokes permission from the specified PostgreSQL user. |
Calls UserService
Get
Returns the specified PostgreSQL User resource.
To get the list of available PostgreSQL User resources, make a List request.
rpc Get (GetUserRequest) returns (User)
GetUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster the user belongs to. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the PostgreSQL User resource to return. To get the name of the user, use a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |
List
Retrieves the list of PostgreSQL User resources in the specified cluster.
rpc List (ListUsersRequest) returns (ListUsersResponse)
ListUsersRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the cluster to list PostgreSQL users in. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListUsersResponse.next_page_token that can be used to get the next page of results in subsequent list requests. The maximum value is 1000. |
page_token | string Page token. To get the next page of results, set page_token to the ListUsersResponse.next_page_token returned by the previous list request. The maximum string length in characters is 100. |
ListUsersResponse
Field | Description |
---|---|
users[] | User List of PostgreSQL User resources. |
next_page_token | string This token allows you to get the next page of results for list requests. If the number of results is larger than ListUsersRequest.page_size, use the next_page_token as the value for the ListUsersRequest.page_token parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results. |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |
Create
Creates a PostgreSQL user in the specified cluster.
rpc Create (CreateUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateUserMetadata
Operation.response:User
CreateUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster to create a user in. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
user_spec | UserSpec Required. Properties of the user to be created. |
UserSpec
Field | Description |
---|---|
name | string Required. Name of the PostgreSQL user. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
password | string Required. Password of the PostgreSQL user. The string length in characters must be 8-128. |
permissions[] | Permission Set of permissions to grant to the user to access specific databases. |
conn_limit | google.protobuf.Int64Value Maximum number of database connections that should be 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. The minimum value is 10. |
settings | UserSettings PostgreSQL settings for the user. |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
CreateUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the PostgreSQL cluster the user is being created in. |
user_name | string Name of the user that is being created. |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Update
Updates the specified PostgreSQL user.
rpc Update (UpdateUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateUserMetadata
Operation.response:User
UpdateUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster the user belongs to. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to be updated. To get the name of the user use a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
update_mask | google.protobuf.FieldMask Field mask that specifies which fields of the PostgreSQL User resource should be updated. |
password | string New password for the user. The string length in characters must be 8-128. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. The minimum value is 10. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption New password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
UpdateUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
user_name | string Name of the user that is being updated. |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Delete
Deletes the specified PostgreSQL user.
rpc Delete (DeleteUserRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteUserMetadata
Operation.response:google.protobuf.Empty
DeleteUserRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster the user belongs to. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to delete. To get the name of the user, use a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
DeleteUserMetadata
Field | Description |
---|---|
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
user_name | string Name of the user that is being deleted. |
GrantPermission
Grants permission to the specified PostgreSQL user.
rpc GrantPermission (GrantUserPermissionRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:GrantUserPermissionMetadata
Operation.response:User
GrantUserPermissionRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster the user belongs to. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to grant the permission to. To get the name of the user, use a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
permission | Permission Required. Permission that should be granted to the specified user. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
GrantUserPermissionMetadata
Field | Description |
---|---|
cluster_id | string ID of the PostgreSQL cluster the user belongs to. To get the cluster ID, use a ClusterService.List request. |
user_name | string Name of the user that is being granted a permission. |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |
RevokePermission
Revokes permission from the specified PostgreSQL user.
rpc RevokePermission (RevokeUserPermissionRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:RevokeUserPermissionMetadata
Operation.response:User
RevokeUserPermissionRequest
Field | Description |
---|---|
cluster_id | string Required. ID of the PostgreSQL cluster the user belongs to. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50. |
user_name | string Required. Name of the user to revoke a permission from. To get the name of the user, use a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
database_name | string Required. Name of the database that the user should lose access to. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]* . |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
RevokeUserPermissionMetadata
Field | Description |
---|---|
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
user_name | string Name of the user whose permission is being revoked. |
User
Field | Description |
---|---|
name | string Name of the PostgreSQL user. |
cluster_id | string ID of the PostgreSQL cluster the user belongs to. |
permissions[] | Permission Set of permissions granted to the user to access specific databases. |
conn_limit | 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_12.effective_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 N concurrent connections will be opened, where N is the value of the setting. Minimum value: 10 (default: 50 ), when used in session pooling. |
settings | UserSettings |
login | google.protobuf.BoolValue This flag defines whether the user can login to a PostgreSQL database. Default value: true (login is allowed). |
grants[] | string A set of roles and privileges that are granted to the user. For more information, see the documentation. The maximum string length in characters for each value is 63. Each value must match the regular expression [a-zA-Z0-9_]* . |
deletion_protection | google.protobuf.BoolValue Deletion Protection inhibits deletion of the user Default value: unspecified (inherits cluster's deletion_protection) |
user_password_encryption | enum UserPasswordEncryption Password-based authentication method for user. Possible values are USER_PASSWORD_ENCRYPTION_MD5 or USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 . The default is password_encryption setting for cluster. |
Permission
Field | Description |
---|---|
database_name | string Name of the database that the permission grants access to. |
UserSettings
Field | Description |
---|---|
default_transaction_isolation | enum TransactionIsolation SQL sets an isolation level for each transaction. This setting defines the default isolation level to be set for all new SQL transactions. See in-depth description in PostgreSQL documentation
|
lock_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) for any statement to wait for acquiring a lock on an table, index, row or other database object. If the wait time is longer than the specified amount, then this statement is aborted. Default value: 0 (no control is enforced, a statement waiting time is unlimited). |
log_min_duration_statement | google.protobuf.Int64Value 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). E.g., if this setting's value is set to 500 , a statement that took 300 milliseconds to complete will not be logged; on the other hand, the one that took 2000 milliseconds to complete, will be logged. Value of 0 forces PostgreSQL to log the duration of all statements. Value of -1 (default) disables logging of the duration of statements. See in-depth description in PostgreSQL documentation |
synchronous_commit | 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 success to the client. These operations guarantee different levels of the data safety and visibility in the cluster. See in-depth description in PostgreSQL documentation
|
temp_file_limit | google.protobuf.Int64Value The maximum storage space size (in kilobytes) that a single process can use to create temporary files. If a transaction exceeds this limit during execution, it will be aborted. 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. |
log_statement | enum LogStatement This setting specifies which SQL statements should be logged (on the user level). See in-depth description in PostgreSQL documentation
|
pool_mode | enum PoolingMode Mode that the connection pooler is working in with specified user. See in-depth description in Odyssey documentation
|
prepared_statements_pooling | google.protobuf.BoolValue User can use prepared statements with transaction pooling. See in-depth description in PostgreSQL documentation |
catchup_timeout | google.protobuf.Int64Value The connection pooler setting. It determines the maximum allowed replication lag (in seconds). Pooler will reject connections to the replica with a lag above this threshold. It can be useful to prevent application from reading stale data. Default value: 0 Value of 0 disables this mechanism |
wal_sender_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for WAL replication (can be set only for PostgreSQL 12+) Terminate replication connections that are inactive for longer than this amount of time. Default value: 60000 (60 seconds). Value of 0 disables the timeout mechanism. See in-depth description in PostgreSQL documentation |
idle_in_transaction_session_timeout | google.protobuf.Int64Value Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. Values of 0 (default) disables the timeout. See in-depth description in PostgreSQL documentation |
statement_timeout | google.protobuf.Int64Value The maximum time (in milliseconds) to wait for statement The timeout is measured from the time a command arrives at the server until it is completed by the server. If log_min_error_statement is set to ERROR or lower, the statement that timed out will also be logged. Value of 0 (default) disables the timeout See in-depth description in PostgreSQL documentation |
pgaudit | PGAuditSettings |
PGAuditSettings
Field | Description |
---|---|
log[] | enum PGAuditSettingsLog |