Yandex Cloud
  • Сервисы
  • Решения
  • Почему Yandex Cloud
  • Сообщество
  • Тарифы
  • Документация
  • Связаться с нами
Подключиться
Language / Region
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
Yandex Managed Service for PostgreSQL
  • Начало работы
  • Пошаговые инструкции
    • Все инструкции
    • Информация об имеющихся кластерах
    • Создание кластера
    • Подключение к базе данных
    • Остановка и запуск кластера
    • SQL-запросы в консоли управления
    • Обновление версии PostgreSQL
    • Изменение настроек кластера и базы данных
    • Подключение к DataLens
    • Управление хостами PostgreSQL
    • Управление базами данных
    • Расширения PostgreSQL
      • Управление расширениями
      • pg_cron
      • pgcrypto
    • Управление пользователями БД
    • Назначение привилегий и ролей
    • Управление резервными копиями
    • Просмотр логов кластера
    • Удаление кластера
    • Диагностика производительности
    • Мониторинг состояния кластера и хостов
    • Управление слотами репликации
  • Практические руководства
    • Все сценарии
    • Создание кластера PostgreSQL для 1С
    • Выгрузка базы данных в Yandex Data Proc
    • Анализ производительности и оптимизация
    • Поставка данных в Yandex Managed Service for Apache Kafka® с помощью Yandex Data Transfer
    • Поставка данных в Yandex Managed Service for YDB с помощью Yandex Data Transfer
    • Поставка данных в Yandex Managed Service for Apache Kafka® с помощью Debezium
    • Репликация и миграция
      • Логическая репликация PostgreSQL
      • Миграция базы данных в Managed Service for PostgreSQL
      • Миграция базы данных из Managed Service for PostgreSQL
      • Создание логической реплики Amazon RDS для PostgreSQL в Managed Service for PostgreSQL
      • Миграция базы данных из Yandex Managed Service for PostgreSQL в Yandex Object Storage
  • Концепции
    • Взаимосвязь ресурсов сервиса
    • Классы хостов
      • Действующие классы хостов
      • Архив
        • До 1 июня 2020 года
      • Использование устаревших классов хостов
    • Сеть в Managed Service for PostgreSQL
    • Квоты и лимиты
    • Хранилище в Managed Service for PostgreSQL
    • Резервные копии
    • Назначение ролей
    • Управление соединениями
    • Репликация
    • Техническое обслуживание
    • Поддерживаемые клиенты
    • Настройки PostgreSQL
    • Ограничения для команд SQL
  • Управление доступом
  • Правила тарификации
    • Действующие правила
    • Архив
      • До 1 января 2019 года
      • С 1 января до 1 марта 2019 года
      • С 1 марта 2019 года до 1 февраля 2020 года
  • Справочник API
    • Аутентификация в API
    • gRPC (англ.)
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST (англ.)
      • Overview
      • Backup
        • Overview
        • delete
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • backup
        • create
        • delete
        • deleteHosts
        • get
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • move
        • rescheduleMaintenance
        • restore
        • start
        • startFailover
        • stop
        • streamLogs
        • update
        • updateHosts
      • Database
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • История изменений
  • Вопросы и ответы
    • Общие вопросы
    • Подключение
    • Изменение кластера
    • Настройки параметров кластера
    • Перемещение и восстановление кластера
    • Мониторинг и логи
    • Все вопросы на одной странице
  1. Справочник API
  2. gRPC (англ.)
  3. UserService

Managed Service for PostgreSQL API, gRPC: UserService

Статья создана
Yandex Cloud
  • Calls UserService
  • Get
    • GetUserRequest
    • User
    • Permission
    • UserSettings
  • List
    • ListUsersRequest
    • ListUsersResponse
    • User
    • Permission
    • UserSettings
  • Create
    • CreateUserRequest
    • UserSpec
    • Permission
    • UserSettings
    • Operation
    • CreateUserMetadata
    • User
  • Update
    • UpdateUserRequest
    • Permission
    • UserSettings
    • Operation
    • UpdateUserMetadata
    • User
  • Delete
    • DeleteUserRequest
    • Operation
    • DeleteUserMetadata
  • GrantPermission
    • GrantUserPermissionRequest
    • Permission
    • Operation
    • GrantUserPermissionMetadata
    • User
    • UserSettings
  • RevokePermission
    • RevokeUserPermissionRequest
    • Operation
    • RevokeUserPermissionMetadata
    • User
    • Permission
    • UserSettings

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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

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<CreateUserMetadata>
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<User>
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_]*.

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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

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<UpdateUserMetadata>
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<User>
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_]*.

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<DeleteUserMetadata>
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<google.protobuf.Empty>
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<GrantUserPermissionMetadata>
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<User>
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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

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<RevokeUserPermissionMetadata>
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<User>
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_]*.

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.
  • TRANSACTION_ISOLATION_READ_UNCOMMITTED: this level behaves like TRANSACTION_ISOLATION_READ_COMMITTED in PostgreSQL.
  • TRANSACTION_ISOLATION_READ_COMMITTED: (default) on this level query sees only data committed before the query began.
  • TRANSACTION_ISOLATION_REPEATABLE_READ: on this level all subsequent queries in a transaction will see the same rows, that were read by the first SELECT or INSERT query in this transaction, unchanged (these rows are locked during the first query).
  • TRANSACTION_ISOLATION_SERIALIZABLE: this level provides the strictest transaction isolation. All queries in the current transaction see only the rows that were fixed prior to execution of the first SELECT or INSERT query in this transaction. If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure.
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.
  • SYNCHRONOUS_COMMIT_ON: (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server.
  • SYNCHRONOUS_COMMIT_OFF: success is reported to the client even if the data is not in WAL. There is no synchronous write operation, data may be loss in case of storage subsystem failure.
  • SYNCHRONOUS_COMMIT_LOCAL: success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. The transaction may be lost due to storage subsystem failure on the master server.
  • SYNCHRONOUS_COMMIT_REMOTE_WRITE: success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby.
  • SYNCHRONOUS_COMMIT_REMOTE_APPLY: success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby.
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.
  • LOG_STATEMENT_NONE: (default) logs none of SQL statements.
  • LOG_STATEMENT_DDL: logs all data definition statements (such as CREATE, ALTER, DROP and others).
  • LOG_STATEMENT_MOD: logs all statements that fall in the LOG_STATEMENT_DDL category plus data-modifying statements (such as INSERT, UPDATE and others).
  • LOG_STATEMENT_ALL: logs all SQL statements.
pool_mode enum PoolingMode
Mode that the connection pooler is working in with specified user.
See in-depth description in Odyssey documentation
  • SESSION: (default) server connection will be assigned to it for the whole duration the client stays connected
  • TRANSACTION: server connection is assigned to a client only during a transaction
  • STATEMENT: server connection will be put back into the pool immediately after a query completes
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 maximum time (in seconds) for synchronization between standby and primary
See in-depth description in PostgreSQL documentation
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: 6000 (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

Была ли статья полезна?

Language / Region
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
В этой статье:
  • Calls UserService
  • Get
  • GetUserRequest
  • User
  • Permission
  • UserSettings
  • List
  • ListUsersRequest
  • ListUsersResponse
  • User
  • Permission
  • UserSettings
  • Create
  • CreateUserRequest
  • UserSpec
  • Permission
  • UserSettings
  • Operation
  • CreateUserMetadata
  • User
  • Update
  • UpdateUserRequest
  • Permission
  • UserSettings
  • Operation
  • UpdateUserMetadata
  • User
  • Delete
  • DeleteUserRequest
  • Operation
  • DeleteUserMetadata
  • GrantPermission
  • GrantUserPermissionRequest
  • Permission
  • Operation
  • GrantUserPermissionMetadata
  • User
  • UserSettings
  • RevokePermission
  • RevokeUserPermissionRequest
  • Operation
  • RevokeUserPermissionMetadata
  • User
  • Permission
  • UserSettings