Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for Sharded PostgreSQL
  • Getting started
    • All guides
    • Getting information on existing clusters
    • Creating a cluster
    • Connecting to a database
    • Managing cluster access
    • Updating a cluster
    • Managing cluster hosts
    • Managing shards
    • Managing backups
    • Maintenance
    • Viewing cluster logs
    • Deleting a cluster
    • Managing users
    • Managing databases
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Getting a list of cluster databases
  • Getting database info
  • Creating a database
  • Deleting a database
  1. Step-by-step guides
  2. Managing databases

Managing databases in Sharded PostgreSQL

Written by
Yandex Cloud
Updated at April 9, 2026
  • Getting a list of cluster databases
  • Getting database info
  • Creating a database
  • Deleting a database

You can add and delete databases, and view their info.

Getting a list of cluster databasesGetting a list of cluster databases

Management console
REST API
gRPC API
  1. Navigate to the Yandex Managed Service for Sharded PostgreSQL service.
  2. Click the name of your cluster and select the Databases tab.
  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Database.List method, e.g., via the following cURL request:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-spqr/v1/clusters/<cluster_ID>/databases'
    
  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the DatabaseService.List method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/spqr/v1/database_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "cluster_id": "<cluster_ID>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.spqr.v1.DatabaseService.List
    
  4. Check the server response to make sure your request was successful.

Getting database infoGetting database info

REST API
gRPC API
  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Database.Get method, e.g., via the following cURL request:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-spqr/v1/clusters/<cluster_ID>/databases/<DB_name>'
    
  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the DatabaseService.Get method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/spqr/v1/database_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "cluster_id": "<cluster_ID>",
            "database_name": "<DB_name>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.spqr.v1.DatabaseService.Get
    
  4. Check the server response to make sure your request was successful.

Creating a databaseCreating a database

Management console
REST API
gRPC API
  1. Navigate to the Yandex Managed Service for Sharded PostgreSQL service.

  2. Click the name of your cluster and select the Databases tab.

  3. Click Create database.

  4. Specify database settings:

    • Name

      The database name may contain Latin letters, numbers, underscores, and hyphens. The name may be up to 63 characters long. The following names are reserved: postgres, template0, and template1. You cannot create databases with these names.

    • Deletion protection

      The possible values are:

      • Like the cluster
      • Enabled
      • DIsabled
  5. Click Create.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Database.Create method, e.g., via the following cURL request:

    curl \
      --request POST \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-spqr/v1/clusters/<cluster_ID>/databases' \
      --data '{
                "databaseSpec": {
                  "name": "<DB_name>",
                  "deletionProtection": "<protect_database_from_deletion>"
                }
              }'
    

    Where databaseSpec are the new database settings:

    • name: Database name.

      The database name may contain Latin letters, numbers, underscores, and hyphens. The name may be up to 63 characters long. The following names are reserved: postgres, template0, and template1. You cannot create databases with these names.

    • deletionProtection: Database deletion protection, true or false.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the DatabaseService.Create method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/spqr/v1/database_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "cluster_id": "<cluster_ID>",
            "database_spec": {
              "name": "<DB_name>",
              "deletion_protection": "<protect_database_from_deletion>"
            }
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.spqr.v1.DatabaseService.Create
    

    Where database_spec are the new database settings:

    • name: Database name.

      The database name may contain Latin letters, numbers, underscores, and hyphens. The name may be up to 63 characters long. The following names are reserved: postgres, template0, and template1. You cannot create databases with these names.

    • deletion_protection: Database deletion protection, true or false.

  4. Check the server response to make sure your request was successful.

Deleting a databaseDeleting a database

Management console
REST API
gRPC API

To delete a database:

  1. Navigate to the Yandex Managed Service for Sharded PostgreSQL service.
  2. Click the name of your cluster and select the Databases tab.
  3. Find the database you need in the list, click in its row, select Delete, then confirm the deletion.
  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Database.Delete method, e.g., via the following cURL request:

    curl \
      --request DELETE \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-spqr/v1/clusters/<cluster_ID>/databases/<DB_name>'
    
  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the DatabaseService.Delete method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/spqr/v1/database_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "cluster_id": "<cluster_ID>",
            "database_name": "<DB_name>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.spqr.v1.DatabaseService.Delete
    
  4. Check the server response to make sure your request was successful.

Was the article helpful?

Previous
Managing users
Next
Resource relationships
© 2026 Direct Cursus Technology L.L.C.