Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • 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 MPP Analytics for PostgreSQL
  • Getting started
    • All guides
    • Connecting to an external file server (gpfdist)
      • Managing extensions
      • gp_relaccess_stats
      • gp_relsizes_stats
      • gp_url_tools
      • pgcrypto
      • try_convert
      • uuid-cb
      • Yezzey
    • Auxiliary utilities
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Installing the uuid-cb extension in a Yandex MPP Analytics for PostgreSQL cluster
  • Usage example
  1. Step-by-step guides
  2. Extensions
  3. uuid-cb

Using uuid-cb in Yandex MPP Analytics for PostgreSQL

Written by
Yandex Cloud
Updated at July 6, 2026
View in Markdown
  • Installing the uuid-cb extension in a Yandex MPP Analytics for PostgreSQL cluster
  • Usage example

Warning

Apache Cloudberry™ does not support this extension.

The uuid-cb extension exports functions for generating and validating unique IDs in compliance with the Russian Central Bank requirements:

  • uuid_cb_generate(): Generates a text value that is a unique ID in the format required by the Russian Central Bank.
  • uuid_cb_valid(text): Returns a boolean value that indicates if a text argument is a unique ID in the format required by the Russian Central Bank.

Installing the uuid-cb extension in a Yandex MPP Analytics for PostgreSQL clusterInstalling the uuid-cb extension in a Yandex MPP Analytics for PostgreSQL cluster

  1. Connect to the database as the owner or a user with the CREATE permission in the database and run this command:

    CREATE EXTENSION "uuid-cb";
    
  2. Make sure the extension has been installed:

    SELECT extname FROM pg_extension;
    

Usage exampleUsage example

  1. Create a table with unique IDs and data such as:

    CREATE TABLE uid_tbl (
        uid TEXT NOT NULL DEFAULT uuid_cb_generate() CHECK (uuid_cb_valid(uid) = true),
        data INTEGER NOT NULL,
        PRIMARY KEY (uid)
        )
    DISTRIBUTED BY(uid);
    

    The unique IDs in the format required by the Russian Central Bank will be generated in the uid column as default values. A check does not allow inserting values that are not unique IDs in the format required by the Russian Central Bank.

  2. Insert the test data into the data column:

    INSERT INTO uid_tbl (data)
    SELECT d FROM generate_series(1, 10) d;
    

    For each command run, pseudorandom ID values are generated.

  3. Check the generated data:

    SELECT * FROM uid_tbl;
    

    Result:

                      uid                   | data 
    ----------------------------------------+------
     4b68f587-6739-11ed-80d4-1b1dc5b7125e-1 |    8
     4b68f589-6739-11ed-80d4-1b1dc5b7125e-1 |   10
     4b68f581-6739-11ed-80d4-1b1dc5b7125e-1 |    2
     4b68f583-6739-11ed-80d4-1b1dc5b7125e-1 |    4
     4b68f585-6739-11ed-80d4-1b1dc5b7125e-1 |    6
     4b68f588-6739-11ed-80d4-1b1dc5b7125e-9 |    9
     4b68f580-6739-11ed-80d4-1b1dc5b7125e-9 |    1
     4b68f582-6739-11ed-80d4-1b1dc5b7125e-9 |    3
     4b68f584-6739-11ed-80d4-1b1dc5b7125e-9 |    5
     4b68f586-6739-11ed-80d4-1b1dc5b7125e-9 |    7
    (10 rows)
    

Apache® and Apache Cloudberry™ are registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.

Was the article helpful?

Previous
try_convert
Next
Yezzey
© 2026 Direct Cursus Technology L.L.C.