Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Ledger Database Functions

Updated on 2024-08-20 GMT+08:00
  • get_dn_hist_relhash(text, text)

    Description: Returns the hash value of table-level data in a specified tamper-proof user table. This function is not supported in the centralized mode.

    Parameter type: text

    Return type: hash16

  • ledger_hist_check(text, text)

    Description: Verifies the consistency between the hash value of table-level data in a specified tamper-proof user table and that in the corresponding history table.

    Parameter type: text

    Return type: Boolean

    Example:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    -- Create a schema.
    gaussdb=# CREATE SCHEMA ledgernsp WITH BLOCKCHAIN;
    -- Create a table.
    gaussdb=# CREATE TABLE ledgernsp.tab(a int, b text);
    -- Insert data.
    gaussdb=# INSERT INTO ledgernsp.tab values(generate_series(1, 10000), 'test');
    gaussdb=# SELECT ledger_hist_check('ledgernsp','tab');
     ledger_hist_check
    -------------------
     t
    (1 row)
    
  • ledger_hist_repair(text, text)

    Description: Restores the hash value of the history table corresponding to the specified tamper-proof user table to be the same as that of the user table, and returns the hash difference.

    Parameter type: text

    Return type: hash16

    Example:

    1
    2
    3
    4
    5
    gaussdb=# SELECT ledger_hist_repair('ledgernsp','tab');
     ledger_hist_repair
    --------------------
     0000000000000000
    (1 row)
    
  • ledger_hist_archive(text, text)

    Description: Archives the history table corresponding to a specified tamper-proof user table to the hist_back folder in the audit log directory.

    Parameter type: text

    Return type: Boolean

    Example:

    1
    2
    3
    4
    5
    gaussdb=# SELECT ledger_hist_archive('ledgernsp','tab');
     ledger_hist_archive
    ---------------------
     t
    (1 row)
    
  • ledger_gchain_check(text, text)

    Description: Verifies the consistency between the history table hash corresponding to the specified tamper-proof user table and the relhash corresponding to the global history table.

    Parameter type: text

    Return type: Boolean

    Example:

    1
    2
    3
    4
    5
    gaussdb=# SELECT ledger_gchain_check('ledgernsp','tab'); 
     ledger_gchain_check
    ---------------------
     t
    (1 row)
    
  • ledger_gchain_repair(text, text)

    Description: Restores relhash of a specified tamper-proof user table in the global history table so that the hash is the same as that in the history table, and returns the total hash value of the specified table.

    Parameter type: text

    Return type: hash16

    Example:

    1
    2
    3
    4
    5
    gaussdb=# SELECT ledger_gchain_repair('ledgernsp','tab'); 
     ledger_gchain_repair
    ----------------------
     da30c1260af5be50
    (1 row)
    
  • ledger_gchain_archive(void)

    Description: Archives global history tables to the hist_back folder in the audit log directory.

    Parameter type: void

    Return type: Boolean

    Example:

    1
    2
    3
    4
    5
    gaussdb=# SELECT ledger_gchain_archive(); 
     ledger_gchain_archive
    -----------------------
     t
    (1 row)
    
  • hash16in(cstring)

    Description: Converts the input hexadecimal string into the internal hash16 format.

    Parameter type: cstring

    Return type: hash16

  • hash16out(hash16)

    Description: Converts internal hash16 data to hexadecimal cstring data.

    Parameter type: hash16

    Return type: cstring

  • hash32in(cstring)

    Description: Converts the input hexadecimal string (32 characters) into the internal type hash32.

    Parameter type: cstring

    Return type: hash32

  • hash32out(hash32)

    Description: Converts internal hash32 data to hexadecimal cstring data.

    Parameter type: hash32

    Return type: cstring

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback