Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for PostgreSQL
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Connecting to databases
    • Stop and start the cluster
    • SQL queries in the management console
    • Changing cluster and database settings
    • Connecting to DataLens
    • Managing PostgreSQL hosts
    • Database management
    • How to manage PostgreSQL extensions
    • Managing database users
    • Granting permissions and roles
    • Managing backups
    • Deleting clusters
    • Database migration to the Cloud
    • Creating a logical replica of Amazon RDS for PostgreSQL in Managed Service for PostgreSQL
  • Solutions
    • Creating a PostgreSQL cluster for 1C
  • Concepts
    • Relationship between service resources
    • Host classes
    • Network in Yandex Managed Service for PostgreSQL
    • Quotas and limits
    • Storage types
    • Backups
    • Assigning roles
    • Replication
    • Supported clients
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1, 2019 to February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • 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
  • Questions and answers
    • General questions
    • Questions about PostgreSQL
    • All questions on the same page
  1. API reference
  2. gRPC
  3. DatabaseService

DatabaseService

  • Calls DatabaseService
  • Get
    • GetDatabaseRequest
    • Database
    • Extension
  • List
    • ListDatabasesRequest
    • ListDatabasesResponse
    • Database
    • Extension
  • Create
    • CreateDatabaseRequest
    • DatabaseSpec
    • Extension
    • Operation
    • CreateDatabaseMetadata
    • Database
    • Extension
  • Update
    • UpdateDatabaseRequest
    • Extension
    • Operation
    • UpdateDatabaseMetadata
    • Database
    • Extension
  • Delete
    • DeleteDatabaseRequest
    • Operation
    • DeleteDatabaseMetadata

A set of methods for managing PostgreSQL Database resources.

Call Description
Get Returns the specified PostgreSQL Database resource.
List Retrieves the list of PostgreSQL Database resources in the specified cluster.
Create Creates a new PostgreSQL database in the specified cluster.
Update Updates the specified PostgreSQL database.
Delete Deletes the specified PostgreSQL database.

Calls DatabaseService

Get

Returns the specified PostgreSQL Database resource.
To get the list of available PostgreSQL Database resources, make a List request.

rpc Get (GetDatabaseRequest) returns (Database)

GetDatabaseRequest

Field Description
cluster_id string
Required. ID of the PostgreSQL cluster that the database belongs to. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
database_name string
Required. Name of the PostgreSQL Database resource to return. To get the name of the database use a DatabaseService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the PostgreSQL cluster that the database belongs to.
owner string
Name of the user assigned as the owner of the database.
lc_collate string
POSIX locale for string sorting order. Can only be set at creation time.
lc_ctype string
POSIX locale for character classification. Can only be set at creation time.
extensions[] Extension
PostgreSQL extensions enabled for the database.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

List

Retrieves the list of PostgreSQL Database resources in the specified cluster.

rpc List (ListDatabasesRequest) returns (ListDatabasesResponse)

ListDatabasesRequest

Field Description
cluster_id string
Required. ID of the PostgreSQL cluster to list databases 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 ListDatabasesResponse.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 ListDatabasesResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.

ListDatabasesResponse

Field Description
databases[] Database
List of PostgreSQL Database 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 ListDatabasesRequest.page_size, use the next_page_token as the value for the ListDatabasesRequest.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.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the PostgreSQL cluster that the database belongs to.
owner string
Name of the user assigned as the owner of the database.
lc_collate string
POSIX locale for string sorting order. Can only be set at creation time.
lc_ctype string
POSIX locale for character classification. Can only be set at creation time.
extensions[] Extension
PostgreSQL extensions enabled for the database.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

Create

Creates a new PostgreSQL database in the specified cluster.

rpc Create (CreateDatabaseRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:CreateDatabaseMetadata

    Operation.response:Database

CreateDatabaseRequest

Field Description
cluster_id string
Required. ID of the PostgreSQL cluster to create a database in. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
database_spec DatabaseSpec
Required. Configuration of the database to create.

DatabaseSpec

Field Description
name string
Required. Name of the PostgreSQL database. 1-63 characters long. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.
owner string
Required. Name of the user to be assigned as the owner of the database. To get the list of available PostgreSQL users, make a UserService.List request. The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_]*.
lc_collate string
POSIX locale for string sorting order. Can only be set at creation time. Value must match the regular expression `
lc_ctype string
POSIX locale for character classification. Can only be set at creation time. Value must match the regular expression `
extensions[] Extension
PostgreSQL extensions to be enabled for the database.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

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<CreateDatabaseMetadata>
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<Database>
if operation finished successfully.

CreateDatabaseMetadata

Field Description
cluster_id string
ID of the PostgreSQL cluster where a database is being created.
database_name string
Name of the PostgreSQL database that is being created.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the PostgreSQL cluster that the database belongs to.
owner string
Name of the user assigned as the owner of the database.
lc_collate string
POSIX locale for string sorting order. Can only be set at creation time.
lc_ctype string
POSIX locale for character classification. Can only be set at creation time.
extensions[] Extension
PostgreSQL extensions enabled for the database.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

Update

Updates the specified PostgreSQL database.

rpc Update (UpdateDatabaseRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:UpdateDatabaseMetadata

    Operation.response:Database

UpdateDatabaseRequest

Field Description
cluster_id string
Required. ID of the PostgreSQL cluster to update a database in. To get the cluster ID use a ClusterService.List request. The maximum string length in characters is 50.
database_name string
Required. Name of the database to update. To get the name of the database use a DatabaseService.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 Database resource should be updated.
extensions[] Extension
PostgreSQL extensions that should be enabled for the database.
If the field is sent, the list of enabled extensions is rewritten entirely. Therefore, to disable an active extension you should simply send the list omitting this extension.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

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<UpdateDatabaseMetadata>
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<Database>
if operation finished successfully.

UpdateDatabaseMetadata

Field Description
cluster_id string
ID of the PostgreSQL cluster where a database is being updated.
database_name string
Name of the PostgreSQL database that is being updated.

Database

Field Description
name string
Name of the database.
cluster_id string
ID of the PostgreSQL cluster that the database belongs to.
owner string
Name of the user assigned as the owner of the database.
lc_collate string
POSIX locale for string sorting order. Can only be set at creation time.
lc_ctype string
POSIX locale for character classification. Can only be set at creation time.
extensions[] Extension
PostgreSQL extensions enabled for the database.

Extension

Field Description
name string
Name of the extension, e.g. pg_trgm or pg_btree. Extensions supported by Managed Service for PostgreSQL are listed in the Developer's Guide.
version string
Version of the extension.

Delete

Deletes the specified PostgreSQL database.

rpc Delete (DeleteDatabaseRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:DeleteDatabaseMetadata

    Operation.response:google.protobuf.Empty

DeleteDatabaseRequest

Field Description
cluster_id string
Required. ID of the PostgreSQL cluster to delete a database in. To get the cluster ID, use a ClusterService.List request. The maximum string length in characters is 50.
database_name string
Required. Name of the database to delete. To get the name of the database, use a DatabaseService.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<DeleteDatabaseMetadata>
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.

DeleteDatabaseMetadata

Field Description
cluster_id string
ID of the PostgreSQL cluster where a database is being deleted.
database_name string
Name of the PostgreSQL database that is being deleted.
In this article:
  • Calls DatabaseService
  • Get
  • GetDatabaseRequest
  • Database
  • Extension
  • List
  • ListDatabasesRequest
  • ListDatabasesResponse
  • Database
  • Extension
  • Create
  • CreateDatabaseRequest
  • DatabaseSpec
  • Extension
  • Operation
  • CreateDatabaseMetadata
  • Database
  • Extension
  • Update
  • UpdateDatabaseRequest
  • Extension
  • Operation
  • UpdateDatabaseMetadata
  • Database
  • Extension
  • Delete
  • DeleteDatabaseRequest
  • Operation
  • DeleteDatabaseMetadata
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC