
Copyright Notice
©2013-2026 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distribute in any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice
All trademarks associated with Tencent Cloud and its services are owned by the Tencent corporate group, including its parent, subsidiaries and affiliated companies, as the case may be. Trademarks of third parties referred to in this document are owned by their respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are subject to change. Specific products and services and the standards applicable to them are exclusively provided for in Tencent Cloud's applicable terms and conditions.
Last updated:2026-03-31 17:14:35

Last updated:2026-03-11 17:43:04


Last updated:2026-03-30 10:33:02


Last updated:2025-08-14 16:25:52






Last updated:2026-03-30 10:59:33

Last updated:2026-03-11 17:52:25

Last updated:2026-03-30 11:09:08


Last updated:2026-09-11 10:19:00


Last updated:2025-05-21 15:53:27
Information | Description |
Data Replication Mode | For the data synchronization mode between the master and the slave, the current two-machine high availability (one master and one slave) architecture supports Async ( Asynchronous replication )and Semi-Sync ( Semi-synchronous replication ). |
Instance Status | Display the current accessibility status of the instance. When the status is normal, normally receive user requests. If an abnormal display occurs, it indicates that the instance currently cannot receive application requests. |
| |
Failover Condition | When the Master node fails and cannot be recovered, automatic failover is required, with the Slave providing services. At this point, the system defines the failover conditions, which are the size and time of primary-backup latency. The default system conditions are less than or equal to 10240 MB and 10 seconds. For specific switch conditions, refer to Failover Description. |
Primary AZ | It refers to the availability zone of the master node. |
Standby AZ | It refers to the availability zone of the slave node. |
Information | Description |
Data Replication Mode | For the data synchronization mode between the master and the slave, the current two-machine high availability (one master and one slave) architecture supports Async ( Asynchronous replication )and Semi-Sync ( Semi-synchronous replication ). |
Instance Status | It displays the current accessibility status of the instance. When the status is normal, user requests are normally received. If the status is abnormal, the instance currently cannot accept application requests. |
Delay Downgrade Condition | When the data replication mode of the instance is semi-synchronous replication, the system will automatically degrade the master and slave replication method to asynchronous to ensure system availability outside the range of user-set conditions. This degradation condition is the master and standby latency size or latency time. Among them, PostgreSQL instances with a large version number of 9 only support the condition of master and standby latency size. For details, see Degradation Description. |
Failover Condition | When the master node fails and cannot be recovered, an automatic failover is required, to switch to the slave to provide service. At this time, the system has defined the failover conditions, which are the size or time of master-slave latency. Applications can modify the switch conditions based on special needs. For details, see Failover Description. |
Primary AZ | It refers to the availability zone of the master node. |
Standby AZ | It refers to the availability zone of the slave node. |

Last updated:2025-05-21 15:53:27



Metric Name | Metric Description |
Slave Log Write-to-Disk Latency (Bytes) | It refers to the difference in size between the slave log write-to-disk LSN and the current LSN of the master instance. For the master instance, this metric reflects the data loss size in the event of a failover. |
Slave Log Write-to-Disk Time Latency (Seconds) | The time difference between the transmission of logs from the primary database to the secondary database and the reception and persistence of these logs on the secondary database reflects the potential data loss during failover for the primary instance. This metric is available only for instance versions 10.x and above. |
Master-Slave Data Synchronization Latency (Bytes) | It refers to the difference in size between the slave replay LSN and the current LSN of the master instance. For the master instance, this metric reflects the RTO in the event of a failover. For read-only instances, this metric reflects the data latency size. |
Master-Slave Data Synchronization Latency Time (Seconds) | The time difference between the transmission of logs from the primary database to the secondary database and the reception and replay of these logs by the secondary database. This metric is available only for instance versions 10.x and above. |
Slave Log Send and Replay Position Difference (Bytes) | It refers to the size difference between the master instance sending the log to the slave instance and the completion of slave log replication. It reflects the speed of slave log application. You can mainly check the performance of the slave instance and the speed of network transmission through this metric. This metric is not available for read-only instances. |
Last updated:2026-03-30 11:18:34







Task type | Input | Output |
Adjusting the Instance Configuration | { "Cpu":"2 core"//CPU configuration before instance adjustment. "Memory":"4 GiB"//Memory configuration before instance adjustment. "Storage":"10 GB"//Storage space configuration before instance adjustment. } | { "Cpu":"2 core"//CPU configuration after instance adjustment. "Memory":"4 GiB"//Memory configuration after instance adjustment. "Storage":"20 GB"//Storage space configuration after instance adjustment. "Message":"success"//Task-specific return, success represents success. For other statuses, see specific information. } |
Changing the read-only group for a read-only instance | { "NewROGroupId":"pgrogrp-3p21ssox"//Target read-only group ID "OldROGroupId":"pgrogrp-dct9wsml"//Source read-only group ID "ROInstanceId":"pgro-a9qea3c9"//Read-only instance ID } | { "NewROGroup":{//Target read-only group details. "ROGroupId":"pgrogrp-3p21ssox" "ROGroupIp":"10.0.0.2" "ROGroupName":"1" "ROGroupPort":5432 } "OldROGroup":{//Source read-only group details. "ROGroupId":"pgrogrp-dct9wsml" "ROGroupIp":"10.0.0.6" "ROGroupName":"2" "ROGroupPort":5432 } "ROInstance":{//Read-only instance details. "ROInstanceId":"pgro-a9qea3c9" "ROInstanceIp":[ 0:"10.0.0.17" ] "ROInstanceName":"Unnamed" "ROInstancePort":5432 } } |
Adding a read-only instance to a read-only group | { "ReadOnlyGroupId":"pgrogrp-3p21ssox"//Target read-only group ID "ReadOnlyInstanceId":"pgro-82nkylkb"//Read-only instance ID } | { "ROGroup":{//Target read-only group details. "ROGroupId":"pgrogrp-3p21ssox" "ROGroupIp":"10.0.0.2" "ROGroupName":"1" "ROGroupPort":5432 } "ROInstance":{//Read-only instance details. "ROInstanceId":"pgro-82nkylkb" "ROInstanceIp":[ 0:"10.0.0.10" ] "ROInstanceName":"Unnamed" "ROInstancePort":5432 } } |
Removing a read-only instance from a read-only group | { "ROGroupId":"pgrogrp-3p21ssox"//Source read-only group details. "ROInstanceId":"pgro-a9qea3c9"//Read-only instance ID } | { "ROGroup":{//Source read-only group details. "ROGroupId":"pgrogrp-3p21ssox" "ROGroupIp":"10.0.0.2" "ROGroupName":"1" "ROGroupPort":5432 } "ROInstance":{//Read-only instance details. "ROInstanceId":"pgro-a9qea3c9" "ROInstanceIp":[ 0:"10.0.0.17" ] "ROInstanceName":"Unnamed" "ROInstancePort":5432 } } |
Adding a network | { "DBInstanceId":"postgres-6s1kuw28"//Instance ID "IsAssignVip":false//Whether the assigned VIP is registered. All are false here. "SubnetId":"subnet-piadji8r"//Subnet ID. "Vip":""//The VIP that is about to be assigned. All are empty here. "VpcId":"vpc-fz41fhgo"//VPC ID } | { "DBInstanceId":"postgres-6s1kuw28"//Instance ID "DBInstanceNetInfo":{//Details of the newly added network. "Address":"" "Ip":"10.0.10.15" "Port":5432 "Status":"opened" "NetType":"private" "VpcId":"vpc-fz41fhgo" "SubnetId":"subnet-piadji8r" "ProtocolType":"postgresql" } } |
Deleting a network | { "DBInstanceId":"postgres-6s1kuw28"//Instance ID "SubnetId":"subnet-piadji8r"//Subnet ID. "Vip":"10.0.10.15"//The VIP to be deleted "VpcId":"vpc-fz41fhgo"//VPC ID } | { "DBInstanceId":"postgres-6s1kuw28"//Instance ID "DBInstanceNetInfo":{//Details of the deleted network. "Address":"" "Ip":"10.0.10.15" "Port":5432 "Status":"closed" "NetType":"private" "VpcId":"vpc-fz41fhgo" "SubnetId":"subnet-piadji8r" "ProtocolType":"postgresql" } } |
Parameter configuration | { "Name":"max_connections"//Modify the parameter name. "ExpectedValue":"2040"//Modify the parameter target value. } | { "max_connections":{//Parameter name. "message":"this parameter must be modified on the master node first and reboot"//Prompt information for reference. "modify_after_value":"2040"//Target value of the parameter. "modify_before_value":"2048"//Original value of the parameter. "status":"success"//Modification status. } } |
Last updated:2026-03-11 16:34:58









Last updated:2024-11-04 09:36:12
Last updated:2025-07-22 20:25:30





Last updated:2025-05-21 15:53:27



Last updated:2025-07-22 20:25:30


Upgrade Time | Description |
Upgrade plugins before completing the major version upgrade. | Under this method, you need to check the plugin list of all databases and upgrade the plugins to the corresponding versions. The execution time is positively correlated with the number of databases and the number of plugins, which will extend the execution time of the entire major version upgrade. Please assess and then select. |
Upgrade plugins after completing the major version upgrade. | Under this method, the database will promptly resume read and write operations upon the completion of the major version upgrade, during which the plugins will undergo updates. However, during the plugin update period, the plugin features may become unavailable. When selecting this upgrade time, you need to evaluate whether your business will be affected. |
Do not upgrade the plugin version | Under this method, the database will promptly resume read and write operations upon completion of the major version upgrade, without automatically upgrading plugins. If needed, you can manually upgrade the plugins. When selecting this upgrade time, you need to evaluate whether your business will be affected. |
Option | Description |
Yes | Default option. Backup will incur fees. For details, reference Backup Space Billing. Users can choose to delete it after upgrade verification is completed. The deletion policy for this backup file is also managed by the user-configured backup retention rules. If you want to extend the backup set retention time, enter the backup recovery interface and click ![]() |
No | Select this option when the instance has backups that can be restored to the pre-upgrade state. Otherwise, it is not recommended. |
Option | Description |
Check without initiating task | Only perform pre-upgrade checks, including instance running status, legitimacy of instance parameter settings, database connection check, etc., but do not initiate the task. Users can use this operation to pre-check the feasibility of the upgrade. |
Check and initiate task | Perform pre-upgrade checks, including instance running status, legitimacy of instance parameter settings, and database connection check. If the check passes, directly initiate the task. |




Last updated:2025-11-20 09:44:41
Scaling Type | Event Metric | Description |
Automatic scaling | ExpandCpuSucceeded | CPU elastic scale-out succeeded. |
| ExpandCpuFailed | CPU elastic scale-out failed. |
| ContractCpuSucceeded | CPU elastic scale-in succeeded. |
Custom scaling | ExpandCpuSucceeded | CPU elastic scale-out succeeded. |
| ExpandCpuFailed | CPU elastic scale-out failed. |
| ContractCpuSucceeded | CPU elastic scale-in succeeded. |

Last updated:2025-11-20 09:44:41


Parameter | Description |
Scale-Out Method | Automatic scale-out and custom scale-out are supported. Select automatic scale-out here. Automatic scale-out: Perform a quick elastic scale-out operation based on performance to adapt to traffic peaks, and perform scale-in when traffic drops. Custom scale-out: Perform scale-out during a custom time period or cycle, and automatically perform CPU scale-in during other periods. |
Number of cores for Scale-Out | The default value is consistent with the number of CPU cores of the current instance specification. For example, if the current instance specification is 2 cores and 4 GiB of memory, the number of cores for scale-out will also be 2 cores. After scale-out is successfully triggered, the CPU of the instance will be 4 cores. |
Scale-Out Rule | Set the observation period and threshold for triggering scale-out. Observation period: Supported options are 1 minute, 3 minutes, 5 minutes, 10 minutes, 15 minutes, and 30 minutes. Threshold: Supported options include 40%, 50%, 60%, 70%, 80%, and 90%. The system will automatically monitor the CPU utilization metrics during the observation period. When the set threshold is reached, a CPU scale-out operation will be initiated. |
Scale-In Rule | Set the observation period and threshold for triggering scale-in. Observation period: Supported options include 5 minutes, 10 minutes, 15 minutes, and 30 minutes. Threshold: Supported options include 10%, 20%, and 30%. The system will automatically monitor the CPU utilization metrics during the observation period. When the set threshold is reached, a CPU scale-in operation will be initiated. |




Last updated:2025-11-20 09:44:42








Last updated:2025-11-20 09:44:42




Last updated:2025-11-20 09:44:42



Last updated:2025-11-20 09:44:42


Last updated:2025-09-11 15:27:47


Last updated:2025-09-10 22:02:23





Specification | Weight |
2 GB memory | 1 |
4 GB memory | 2 |
8 GB memory | 2 |
12 GB memory | 4 |
16 GB memory | 4 |
24 GB memory | 8 |
32 GB memory | 8 |
48 GB memory | 10 |
64 GB memory | 12 |
96 GB memory | 14 |
128 GB memory | 16 |
240 GB memory | 26 |
480 GB memory | 50 |


Last updated:2024-01-24 11:16:51
Specification | Weight |
2 GB memory | 1 |
4 GB memory | 2 |
8 GB memory | 2 |
12 GB memory | 4 |
16 GB memory | 4 |
24 GB memory | 8 |
32 GB memory | 8 |
48 GB memory | 10 |
64 GB memory | 12 |
96 GB memory | 14 |
128 GB memory | 16 |
240 GB memory | 26 |
480 GB memory | 50 |
Last updated:2024-01-24 11:16:51
CREATE ROLE name [ [ WITH ] option [ ... ] ]where option can be:SUPERUSER | NOSUPERUSER| CREATEDB | NOCREATEDB| CREATEROLE | NOCREATEROLE| INHERIT | NOINHERIT| LOGIN | NOLOGIN| REPLICATION | NOREPLICATION| BYPASSRLS | NOBYPASSRLS| CONNECTION LIMIT connlimit| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL| VALID UNTIL 'timestamp'| IN ROLE role_name [, ...]| IN GROUP role_name [, ...]| ROLE role_name [, ...]| ADMIN role_name [, ...]| USER role_name [, ...]| SYSID uid
Role | Allowed Access |
pg_execute_server_program | Allow executing programs on the database server as the user the database runs as with COPY and other functions which allow executing a server-side program. |
pg_monitor | Read/Execute various monitoring views and functions. This role is a member of pg_read_all_settings, pg_read_all_stats, and pg_stat_scan_tables. |
pg_read_all_settings | Read all configuration variables, even those normally visible only to superusers. |
pg_read_all_stats | Read all pg_stat_* views and use various statistics related extensions, even those normally visible only to superusers. |
pg_read_server_files | Allow reading files from any location the database can access on the server with COPY and other file-access functions. |
pg_signal_backend | Signal another backend to cancel a query or terminate its session. |
pg_stat_scan_tables | Execute monitoring functions that may take ACCESS SHARE locks on tables, potentially for a long time. |
pg_write_server_files | Allow writing to files in any location the database can access on the server with COPY and other file-access functions. |
public | An implicitly defined group that always includes all roles. Any particular role will have the sum of permissions granted directly to public. PostgreSQL grants default permissions on some types of objects to public. |
Permissions | Abbreviation | Supported Object |
SELECT | r ("read") | LARGE OBJECT, SEQUENCE, TABLE (and table-like objects), table column |
INSERT | a ("append") | TABLE, table column |
UPDATE | w ("write") | LARGE OBJECT, SEQUENCE, TABLE, table column |
DELETE | d | TABLE |
TRUNCATE | D | TABLE |
REFERENCES | x | TABLE, table column |
TRIGGER | t | TABLE |
CREATE | C | DATABASE, SCHEMA, TABLESPACE |
CONNECT | c | DATABASE |
TEMPORARY | T | DATABASE |
EXECUTE | X | FUNCTION, PROCEDURE |
USAGE | U | DOMAIN, FOREIGN DATA WRAPPER, FOREIGN SERVER, LANGUAGE, SCHEMA, SEQUENCE, TYPE |
Object Type | Permissions | Permissions of Default Role (public) | psql Command to Query Permissions |
DATABASE | CTc | Tc | \l |
DOMAIN | U | U | \dD+ |
FUNCTION or PROCEDURE | X | X | \df+ |
FOREIGN DATA WRAPPER | U | none | \dew+ |
FOREIGN SERVER | U | none | \des+ |
LANGUAGE | U | U | \dL+ |
LARGE OBJECT | rw | none | - |
SCHEMA | UC | none | \dn+ |
SEQUENCE | rwU | none | \dp |
TABLE (and table-like objects) | arwdDxt | none | \dp |
Table column | arwx | none | \dp |
TABLESPACE | C | none | \db+ |
TYPE | U | U | \dT+ |
postgres=# \dpAccess privilegesSchema | Name | Type | Access privileges | Column privileges | Policies--------+------+-------+-------------------+-------------------+----------public | t1 | table | test1=arwdDxt/test1 | |(1 rows)postgres=# grant select on t1 to normal_user;GRANTpostgres=# grant insert on t1 to normal_user with grant option;GRANTpostgres=# grant update on t1 to public;GRANTpostgres=# grant select (a) on t1 to test2;GRANTpostgres=# \dpAccess privilegesSchema | Name | Type | Access privileges | Column privileges | Policies--------+------+-------+-----------------------+-------------------+----------public | t1 | table | test1=arwdDxt/test1 +| a: +|| | | normal_user=a*r/test1+| test2=r/test1 || | | =w/test1 | |(1 rows)-- Where, "=w/test1" specifies that test1 grants public the UPDATE privilege.
Last updated:2026-06-25 11:47:14
Permissions | Description |
CREATEDB | You can create databases. |
BYPASSRLS | It can bypass all row-level security policy checks. |
REPLICATION | By default, it has the replication permission and can also grant this permission to other users. |
CREATEROLE | It has the CREATEROLE permission as in the community edition, but the pg_read_server_files, pg_write_server_files, and pg_execute_server_program permissions have been removed from the createrole permission set. |
Object | Description |
database | By default, it has permissions for all databases whose owner is not a superuser. |
schema | By default, it has permissions for all schemas whose owner is not a superuser. |
table/sequence | By default, it has permissions for all tables/sequences whose owner is not a superuser. |
function | By default, it has permissions for all functions whose owner is not a superuser. |
language | No special permissions. |
tablespace | No special permissions. |
FDW / foreign server | By default, it has permissions for all FDWs/foreign servers whose owner is not a superuser. |
TYPE | By default, it has permissions for all types whose owner is not a superuser. |
CREATE USER name [ [ WITH ] option [ ... ] ]where option can be:SUPERUSER | NOSUPERUSER| CREATEDB | NOCREATEDB| CREATEROLE | NOCREATEROLE| INHERIT | NOINHERIT| LOGIN | NOLOGIN| REPLICATION | NOREPLICATION| BYPASSRLS | NOBYPASSRLS| CONNECTION LIMIT connlimit| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL| VALID UNTIL 'timestamp'| IN ROLE role_name [, ...]| IN GROUP role_name [, ...]| ROLE role_name [, ...]| ADMIN role_name [, ...]| USER role_name [, ...]| SYSID uid
CREATE ROLE name [ [ WITH ] option [ ... ] ]where option can be:SUPERUSER | NOSUPERUSER| CREATEDB | NOCREATEDB| CREATEROLE | NOCREATEROLE| INHERIT | NOINHERIT| LOGIN | NOLOGIN| REPLICATION | NOREPLICATION| BYPASSRLS | NOBYPASSRLS| CONNECTION LIMIT connlimit| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL| VALID UNTIL 'timestamp'| IN ROLE role_name [, ...]| IN GROUP role_name [, ...]| ROLE role_name [, ...]| ADMIN role_name [, ...]| USER role_name [, ...]| SYSID uid
ALTER ROLE role_specification [ WITH ] option [ ... ]where option can be:SUPERUSER | NOSUPERUSER| CREATEDB | NOCREATEDB| CREATEROLE | NOCREATEROLE| INHERIT | NOINHERIT| LOGIN | NOLOGIN| REPLICATION | NOREPLICATION| BYPASSRLS | NOBYPASSRLS| CONNECTION LIMIT connlimit| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL| VALID UNTIL 'timestamp'
# Simple SyntaxGRANT <permission> on <object> to <role>;
# Simple SyntaxREVOKE <permission> ON <object> FROM <role>;
# Simple SyntaxGRANT <role_name> to <other_role>;
Account Name | Description | Allowed Operations |
tencentdb_admin_* | The string following 'tencentdb_admin_' in the account name and role name is a system-generated random string. | Used by the monitoring component to collect monitoring data and by the management system to perform instance health checks. |
tencentdb_repl_* | The string following 'tencentdb_repl_' in the account name and role name is a system-generated random string. | To implement master-slave data synchronization for instances and to support the backup feature of the backup component. |
repluser | Belongs to the repluser role. | Used by some instances to implement master-slave data synchronization. This account will be deprecated later. |
Last updated:2025-07-22 20:25:30















nomal_1=> select datname,datacl from pg_database;datname | datacl-----------+------------------------------------------------------------------------template1 | {=c/postgres,postgres=CTc/postgres}template0 | {=c/postgres,postgres=CTc/postgres}postgres | {=Tc/postgres,postgres=CTc/postgres,pg_tencentdb_superuser=C/postgres}nomal_1 | {=Tc/nomal_usr1,nomal_usr1=CTc/nomal_usr1}db_priv | {=Tc/dbadmin,dbadmin=Tc/dbadmin}(5 rows)
nomal_1=> select nspname,nspacl from pg_namespace;nspname | nspacl--------------------+----------------------------------------------------------pg_toast |pg_temp_1 |pg_toast_temp_1 |pg_catalog | {postgres=UC/postgres,=U/postgres}public | {postgres=UC/postgres,=UC/postgres}information_schema | {postgres=UC/postgres,=U/postgres,nomal_usr1=C/postgres}sche_priv | {dbadmin=UC/dbadmin}(7 rows)
nomal_1=> select relname,a.typname as reltype ,relacl from pg_class join pg_type a on pg_class.reltype=a.oid ;
nomal_1=> SELECT r.rolname,d.datdba,datname AS database_name FROM pg_database d left JOIN pg_catalog.pg_roles r on d.datdba=r.oid WHERE d.datdba in (SELECT usesysid FROM pg_user WHERE usename in('dbadmin','nomal_usr1','nomal_usr2'));rolname | datdba | database_name------------+--------+---------------dbadmin | 16398 | db_privnomal_usr1 | 16401 | nomal_1
nomal_1=> SELECT n.nspname as schema_name, pg_catalog.pg_get_userbyid(n.nspowner) as schema_owner FROM pg_catalog.pg_namespace n ORDER BY schema_name;schema_name | schema_owner--------------------+--------------information_schema | postgrespg_catalog | postgrespg_temp_1 | postgrespg_toast | postgrespg_toast_temp_1 | postgrespublic | postgressche_priv | dbadmin
nomal_1=> select * from (select relname,relnamespace as schema_name ,a.typname as reltype,pg_catalog.pg_get_userbyid(relowner )as owner from pg_class join pg_type a on pg_class.reltype=a.oid ) d where owner in('dbadmin','nomal_1');relname | schema_name | reltype | owner----------------+-------------+----------------+---------pg_toast_16488 | 99 | pg_toast_16488 | dbadminamyttt | 16480 | amyttt | dbadminam | 2200 | am | dbadminam_s | 16480 | am_s | dbadminbug_id_seq | 2200 | bug_id_seq | dbadminbug | 2200 | bug | dbadminpg_toast_16507 | 99 | pg_toast_16507 | dbadmin





Last updated:2025-11-03 14:21:06
Object Type | Default PUBLIC Permission |
Databases | CONNECT,TEMPORARY |
Functions/Procedures | EXECUTE |
Languages | USAGE |
Data Types | USAGE |
drop extension tencentdb_superuser; in the corresponding database, then execute create extension tencentdb_superuser; before using this capacity after upgrading the kernel minor version.

[am@VM-91-60-centos ~]$psql -h10.*.*.* -p5432 -Udbadmin -dtest_dbPassword for user dbadmin:psql (16.0, server 16.10)Type "help" for help.
test_db=> \c - am_apsql (16.0, server 16.10)You are now connected to database "test_db" as user "am_a".test_db=> select oid FROM pg_class LIMIT 1;oid------2619(1 row)
test_db=> \c - dbadminPassword for user dbadmin:psql (16.0, server 16.10)You are now connected to database "test_db" as user "dbadmin".test_db=> REVOKE SELECT ON pg_class FROM PUBLIC;REVOKEtest_db=> \c - am_aPassword for user am_a:psql (16.0, server 16.10)You are now connected to database "test_db" as user "am_a".test_db=> select oid FROM pg_class LIMIT 1;ERROR: permission denied for table pg_class
test_db=> \c - dbadminPassword for user dbadmin:psql (16.0, server 16.10)You are now connected to database "test_db" as user "dbadmin".test_db=> REVOKE CONNECT ON DATABASE test_db FROM PUBLIC;REVOKEtest_db=> \c - am_aPassword for user am_a:connection to server at "10.*.*.*", port 5432 failed: FATAL: permission denied for database "test_db"DETAIL: User does not have CONNECT privilege.Previous connection kept
test_db=> \c - dbadminpsql (16.0, server 16.10)You are now connected to database "test_db" as user "dbadmin".test_db=> GRANT CONNECT ON DATABASE test_db TO am_a;GRANTtest_db=> GRANT SELECT ON pg_class TO am_a;GRANTtest_db=> \c - am_aPassword for user am_a:psql (16.0, server 16.10)You are now connected to database "test_db" as user "am_a".test_db=> select oid FROM pg_class LIMIT 1;oid------2619(1 row)
Last updated:2026-03-31 10:27:50





Last updated:2026-03-31 14:43:07

Last updated:2026-08-27 16:13:02
Region | Price (USD/CU/Hour) |
Guangzhou, Nanjing, Shanghai, Beijing, Chengdu, Chongqing, Tianjin, and Shenzhen | 0.06865672 |
Hong Kong (China) | 0.11492537 |
Riyadh | 0.13529412 |
Tokyo, Seoul, Sao Paulo, Singapore, Bangkok, Virginia, Silicon Valley, Jakarta, and Frankfurt | 0.11791045 |
Shenzhen Finance, Shanghai Finance, and Beijing Finance | 0.11641791 |

Directory | Description | Documentation Link | |
Database Proxy Overview | | Introduces database proxy features, billing, and more | This document |
Database Proxy Kernel Features | Kernel Minor Version Release Notes | Describes the released version update history of the database proxy | |
Managing Database Proxy | Enabling Database Proxy | Describes how to enable the database proxy for an instance through the console. | |
| View Access Policy | Describes how to view the access policy of the database proxy connection address through the console. | |
| Adjusting the Database Proxy Configuration | Describes how to adjust the proxy specifications, AZs, and node quantity of the database proxy. | |
| Rebalancing the Load | Describes how to distribute connections by rebalancing the load. | |
| Disabling the Database Proxy | Describes how to disable the database proxy through the console. | |
Connection Pool Feature | Connection Pool Overview | Describes the connection pool feature and instructions of the database proxy. | |
| Enabling and Disabling the Connection Pool Feature | Describes the instructions and operations for enabling and disabling the connection pool feature. | |
Last updated:2026-08-27 16:07:39

Last updated:2026-08-27 16:04:25

Parameter | Description |
Node Specification | Supported node specifications: 2-core/4000MB, 4-core/8000MB, 8-core/16000MB. |
AZ and Number of Nodes | Select the AZ for the database proxy. The available resources are subject to what is displayed on the actual configuration page. Select the number of nodes. The recommended method for calculating the number of proxy nodes is as follows: The recommended number of proxy nodes is 1/16 of the total CPU cores of the primary instance and read-only instances, rounded up. For example, if the primary instance has 8 CPU cores and the read-only instance has 16 CPU cores, the recommended number of proxy nodes = (8 + 16)/16 ≈ 2. Note: If the calculated number of required proxy nodes exceeds the purchase limit, choose proxy nodes with higher specifications. |
VPC | Select the network for the database proxy. Only VPC is supported. To create a VPC, click Create VPC. |
Subnet | |
Security Group | Select an existing security group or create a new one. To create a security group, click Create Security Group. Note: To access the database proxy, configure a security policy to allow traffic through the private network access port. For details, see Managing Security Groups. |
Description | Enter a description for the proxy (optional). |
Last updated:2026-08-27 16:04:25

Last updated:2026-08-27 16:04:25


Parameter | Description |
Node Specification | Modify the proxy node specification. Both upgrades and downgrades are supported. Options include: 2-core/4000MB, 4-core/8000MB, 8-core/16000MB. |
AZ and Number of Nodes | Modify the AZ or number of nodes. For specific available resources, refer to the actual configuration page. The number of proxy nodes is 1/16 of the sum of the CPU cores of the primary instance and read-only instances (rounded up). For example, if the primary instance has 8 CPU cores and the read-only instance has 16 CPU cores, the recommended number of proxy nodes = (8+16)/16 ≈ 2, with a maximum of 4. |
Rebalance Method | Select a rebalancing method. Supported options: Automatic rebalance: After configuration adjustments are completed and the switchover time arrives, the system automatically rebalances the load. Manual rebalance: After configuration adjustments are completed, manually perform Reconfigure Load Balancing under Connection Address in Overview on the Database Proxy page. |
Switch Time | Set Switch Time: Upon upgrade completion: After configuration adjustments are completed, the system automatically switches to the new configuration. Specify time: The user specifies a switchover time range, with a minimum interval of 30 minutes. During maintenance time: After configuration adjustments are completed, the system performs the switchover within your specified maintenance window. If you selected switchover within the maintenance window but need to switch earlier due to business requirements, you can manually perform the switchover on the database proxy page after configuration adjustments are completed. |
Last updated:2026-09-02 16:57:32



Last updated:2026-08-27 16:04:25


Last updated:2026-08-27 16:04:25


Last updated:2026-09-02 16:57:33

select proname, provolatile from pg_proc where proname = '<function name>';./* master */ hint, or switch to the direct connection address of the primary instance.SELECT p.proname, p.provolatileFROM pg_proc pJOIN pg_namespace n ON n.oid = p.pronamespaceWHERE n.nspname = 'pg_catalog'AND p.provolatile IN ('s', 'i')AND (p.proname ~ '^(inet_|pg_stat_|pg_current_|pg_last_|pg_control_|pg_is_|pg_backend|pg_postmaster|pg_conf_|pg_ls_)'OR p.proname IN ('current_setting', 'version'))ORDER BY p.provolatile, p.proname;
Category | Typical Function / View | Behavior When a Fallback to RO Is Performed |
Connection and instance identity | inet_server_addr (tested s), inet_server_port (tested s), inet_client_addr (tested s), pg_backend_pid, pg_postmaster_start_time, pg_conf_load_time | Returns the address/port/PID/startup time of the RO node itself, which differ from those of the primary instance. These values drift when multiple ROs exist. |
Parameters and configuration | current_setting('...'),SHOW <param>,pg_settings | Values differ when the primary/RO specifications or parameter templates are different (such as max_connections, work_mem, hot_standby, and default_transaction_read_only). |
Statistics and runtime views | pg_stat_activity,pg_stat_replication,pg_replication_slots,pg_stat_database,pg_locks,pg_stat_user_tables | Session replication slot statistics of the primary instance are not visible, or the statistical scope differs. As a result, conclusions are incorrect when businesses monitor connection counts, kill sessions, or monitor latency. |
Recovery/role status and WAL position | pg_is_in_recovery,pg_last_wal_replay_lsn,pg_current_wal_lsn,pg_control_checkpoint | If these functions are marked as v in the target version, they are routed to the primary instance by rule. If they are marked as s, their semantics are reversed after they fall to the RO (primary f/RO t), or the position lags behind. |
Last updated:2026-09-02 16:57:33


Parameter | Description |
Address ID | Displays the ID of the database proxy connection address. |
Connection Address | Displays the private network connection address of the database proxy. |
Read Attribute | Defaults to read/write splitting. |
Assign Read Weight | The database proxy needs to distribute read requests to different instances. By assigning different read weights to each instance, the database proxy can determine the target instance for forwarding requests based on the weight. The weight can be automatically assigned by the system or customized. If the weight is customized, you can configure the weight for different instances. The descriptions of the enabling status and weight during weight assignment are as follows: Enable: Turning on the switch means that the selected instance will be assigned connections. Turning off the switch means that the selected instance will not be assigned connections. Weight: Weight range: 0-100. 0 means that the corresponding instance will be assigned a weight for connection, but the weight is the lowest. The larger the value, the higher the weight, and the more read requests. After the read weights are assigned, read requests will be routed to the corresponding instances in proportion. For example, if the read weights of Instance 1, Instance 2, and Instance 3 are set to 3, 2, and 1, read requests from the database proxy connection address will be routed to Instance 1, Instance 2, and Instance 3 in the ratio of 3:2:1. Note: The weight here is for read requests (non-transactional). The weight setting takes effect only for new connections. It does not take effect for existing data connections. |
Delay Eviction | Set the delayed removal policy for read-only instances. When this feature is enabled, you can set the delayed removal threshold and the minimum number of read-only instances to retain. Whether this feature is enabled or not, the system always attempts to remove and recover a read-only instance when it fails. Delay Eviction Threshold (s): input an integer greater than or equal to 1, in seconds. Minimum Retained Read-Only Instances: The number is related to the number of read-only instances that the primary instance has. If it is set to 0, after all read-only nodes are removed, all access will be forwarded to the primary instance until the read-only instances rejoin. |
Auto-Add Read-Only Instances | Determine whether to enable this feature. Once it is enabled, newly purchased read-only instances will be automatically added to the database proxy. If the read weight is automatically assigned by the system, a weight is assigned to newly purchased read-only instances according to the specification. If the read weight is customized, the weight of newly purchased read-only instances is 0 by default when they are added. You can click Adjust Configuration on the Database Proxy > Connection Address page to modify the weight. |
Connection Pool | The connection pool feature is mainly used to reduce instance load caused by frequent establishment of new connections in short-connection services. After it is enabled, only transaction-level connection pooling is supported. |
Load Balancing Policy | Set the load balancing policy. Supported options include: by active connections and by number of requests. |
Description | Enter a description for the database proxy connection address for easier management. |
Last updated:2026-08-27 16:13:03

Last updated:2026-08-27 16:13:03


Last updated:2025-08-14 16:29:50








Last updated:2025-06-16 17:32:07
Specification\Parameter | max_replication_slots | max_wal_senders | max_worker_processes | max_logical_replication_workers | max_parallel_workers | max_connections |
1C2GiB | [10-100] | [27-150] | [4-300] | [4-150] | [8-8] | [100-2048] |
2C4GiB | [10-100] | [27-150] | [4-300] | [4-150] | [8-8] | [100-2048] |
2C6GiB | [10-150] | [27-200] | [4-400] | [4-200] | [8-8] | [100-2048] |
4C8GiB | [10-150] | [27-200] | [4-400] | [4-200] | [8-8] | [100-2048] |
4C16GiB | [10-150] | [27-200] | [4-400] | [4-200] | [8-8] | [100-2048] |
6C24GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-12] | [100-2048] |
8C16GiB | [10-150] | [27-200] | [4-400] | [4-200] | [8-8] | [100-2048] |
8C32GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-16] | [100-4000] |
8C48GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-16] | [100-4500] |
8C64GiB | [10-400] | [27-450] | [4-900] | [4-450] | [8-24] | [100-5500] |
12C24GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-12] | [100-2048] |
12C64GiB | [10-400] | [27-450] | [4-900] | [4-450] | [8-24] | [100-5500] |
16C32GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-16] | [100-4000] |
16C96GiB | [10-400] | [27-450] | [4-900] | [4-450] | [8-32] | [100-8000] |
20C128GiB | [10-500] | [27-450] | [4-900] | [4-450] | [8-40] | [100-10000] |
24C48GiB | [10-200] | [27-250] | [4-500] | [4-250] | [8-16] | [100-4500] |
24C192GiB | [10-500] | [27-550] | [4-1200] | [4-550] | [8-50] | [100-12000] |
28C240GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-13000] |
32C64GiB | [10-400] | [27-450] | [4-900] | [4-450] | [8-24] | [100-5500] |
48C480GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-22000] |
64C256GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-13000] |
64C384GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-20000] |
64C512GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-22000] |
90C720GiB | [10-600] | [27-650] | [4-1300] | [4-650] | [8-60] | [100-36000] |
Last updated:2025-06-09 10:25:33
**.conf to import and create a template.







Last updated:2024-10-28 15:03:30
Instance Type | Instance Configuration | Maximum max_connections Value |
Primary instance | 8 CPU cores and 48 GB memory with 100 GB disk | 4500 |
Read-only instance | 1 CPU core and 2 GB memory with 100 GB disk | 2048 |
Read-only instance | 1 CPU core and 2 GB memory with 100 GB disk | 2048 |



Last updated:2026-01-26 14:15:59
-- View table typeSELECTschemaname,tablename,CASEWHEN relpersistence = 'u' THEN 'UNLOGGED'WHEN relpersistence = 'p' THEN 'PERMANENT'ELSE 'OTHER'END as table_typeFROM pg_tables tJOIN pg_class c ON c.relname = t.tablenameWHERE schemaname = 'public';
-- Convert UNLOGGED tables to regular tables, where unlogged_table_name is the table nameALTER TABLE unlogged_table_name SET LOGGED;-- Lock status monitoring: the mode field indicates the lock type, AccessExclusiveLock is the most restrictive lock, and unlogged_table_name is the table nameSELECTl.locktype,l.mode,l.granted,l.pid,a.state,a.query_start,now() - a.query_start as duration,CASEWHEN l.granted THEN 'GRANTED'ELSE 'WAITING'END as lock_status,substring(a.query, 1, 80) as query_snippetFROM pg_locks lLEFT JOIN pg_stat_activity a ON l.pid = a.pidWHERE l.relation IS NOT NULLAND EXISTS (SELECT 1 FROM pg_class cWHERE c.oid = l.relationAND c.relname = 'unlogged_table_name')ORDER BY l.granted, a.query_start;
-- For large tables, it is recommended to convert them in batches-- 1. Create a new LOGGED tableCREATE TABLE user_cache_new (LIKE user_cache);-- 2. Migrate data in batchesINSERT INTO user_cache_newSELECT * FROM user_cacheWHERE created_at >= '2024-01-01' AND created_at < '2024-01-02';-- 3. Rename the tableBEGIN;DROP TABLE user_cache;ALTER TABLE user_cache_new RENAME TO user_cache;COMMIT;
tencentdb_log_unlogged_table parameter, while maintaining PostgreSQL's native functionality, to provide users with enhanced data security. For modifying parameters, see Setting Instance Parameters.-- Create UNLOGGED tableamy=> CREATE UNLOGGED TABLE test_table (id INT, data TEXT);-- System WARNING:WARNING: change unlogged table to logged table, If you want to use unlogged tables, please set tencentdb_log_unlogged_table to false.CREATE TABLE-- Verify table type, returns: 'p' (PERMANENT/LOGGED)am=> SELECT relpersistence FROM pg_class WHERE relname = 'test_table';relpersistence----------------p(1 row
tencentdb_log_unlogged_table Parameter Require Rebooting the Instance?ALTER TABLE SET LOGGED conversion.Last updated:2026-02-11 20:33:56




Last updated:2025-07-22 20:25:30

Last updated:2025-11-03 14:26:13

Parameter Value | Description |
postgresql_%a_%H.log | Selecting this value will keep logs for 7 days. |
postgresql_%d_%H.log | Selecting this value allows logs to be retained for 30 days, which is the system default. |

SELECT pg_rotate_logfile();
Last updated:2026-03-31 14:51:41
Field Value | Type | Description |
Timestamp | - | The reserved field in CLS, which is used to represent the log generation time. |
InstanceId | String | Database instance ID, such as postgres-xxx. |
Database | Long | The database used by the client to connect to the database instance. |
UserName | String | The username used by the client to connect to the database instance. |
ErrMsg | String | The raw SQL log of the error log. |
ErrTime | String | Error occurrence time. |
Field Value | Type | Description |
Timestamp | - | The reserved field in CLS, which is used to represent the log generation time. |
InstanceId | String | Database instance ID, such as postgres-xxx. |
DatabaseName | String | The database to which the client connects. |
UserName | String | User of client connection. |
RawQuery | String | Slow log content. |
Duration | String | Duration. |
ClientAddr | String | Client address. |
SessionStartTime | Unix timestamp | Session start time. |





Parameter | Description |
Destination region | Select the region for log shipping. Cross-region shipping is supported. |
Log topic operations | A log topic is the basic unit for log data collection, storage, retrieval, and analysis. You can Select existing log topic or Create Log Topic. |
Select existing log topic | If the log topic is set to Select existing log topic, you need to further select the existing logset and log topic. Logset: Logset classify log topic to facilitate log topic management. You can filter existing logset in the search box. Log Topic: A log topic is the basic unit for collecting, storing, retrieving, and analyzing log data. You can filter log topics of the selected logset in the search box. |
Create Log Topic | If the log topic is set to Create Log Topic, you need to further customize the log topic and then assign it to an existing logset or a created logset. Log Topic: A log topic is the basic unit for collecting, storing, retrieving, and analyzing log data. You need to create a log topic. Select the existing logset: The log topic to be created will be added to an existing logset. If you select this option, you can filter existing logsets in the search box. Create Logset: The log topic to be created will be added to a newly created logset. If you select this option, you need to create a logset. |






Parameter | Description |
Destination region | Select the region for log shipping. Cross-region shipping is supported. |
Log topic operations | A log topic is the basic unit for log data collection, storage, retrieval, and analysis. You can Select existing log topic or Create Log Topic. |
Select existing log topic | If the log topic is set to Select existing log topic, you need to further select the existing logset and log topic. Logset: Logset classify log topic to facilitate log topic management. You can filter existing logset in the search box. Log Topic: A log topic is the basic unit for collecting, storing, retrieving, and analyzing log data. You can filter log topics of the selected logset in the search box. |
Create Log Topic | If the log topic is set to Create Log Topic, you need to further customize the log topic and then assign it to an existing logset or a created logset. Log Topic: A log topic is the basic unit for collecting, storing, retrieving, and analyzing log data. You need to create a log topic. Select the existing logset: The log topic to be created will be added to an existing logset. If you select this option, you can filter existing logsets in the search box. Create Logset: The log topic to be created will be added to a newly created logset. If you select this option, you need to create a logset. |

Last updated:2024-03-20 14:30:33

Operation Type | Backup Type | Operation Details |
Data Backup | Data Backup | The system will trigger a full data backup according to your automatic backup setting within the specified time. The backup method is physical backup, which offers fast backup speed and higher recovery efficiency. The generated full automatic backup data is retained based on the data backup retention time you set. The backup data will not be deleted when the instance is terminated. It will be automatically deleted when it expires. This can meet your need to extend the retention of backup data to prevent serious impact due to accidental deletion of instances. Since full backup uses backup storage space, you can delete it promptly if necessary. The automatic backup data within one week cannot be deleted, while data older than one week can be flexibly deleted according to your needs. Please be cautious when deleting backup data as it cannot be recovered after deletion. |
| Manual Backup | You can manually initiate a full instance backup based on application needs through the console. After the manual backup task is initiated, the system will perform a full instance backup using the physical backup method within 1 minute. The expiration time of manual backups is one week after they are initiated. Since manual backups occupy backup storage space, you can delete manual backups promptly if necessary. |
| Incremental Backup | Incremental backup is WAL log backup, which is automatically enabled by default and cannot be disabled. The incremental backup is stored based on the data backup retention time you set. The system will perform real-time backup based on the WAL log generated by the database. Since incremental backup occupies backup storage space, you can delete it promptly if necessary. Incremental backup data within a week is not allowed to be deleted, while data older than one week can be flexibly deleted according to your needs. After the incremental backup data is deleted, point-in-time recovery cannot be performed, so exercise caution when deleting incremental backup data. |
Backup Files Download | Download Full Backup | Supports local browser download and download by address. |
| Download Incremental Backup | Supports local browser download and download by address. |
Transfer Historical Backup Through Serverless Cloud Function | Transfer through Serverless Cloud Function | You can transfer historical backup data using the Serverless Cloud Function. For more information, please see Use Serverless Cloud Function to transfer historical PostgreSQL backup. |
Last updated:2026-08-26 14:31:26




Last updated:2026-05-15 14:33:59




Last updated:2026-03-31 11:41:25


Last updated:2025-05-19 12:01:32


Parameter | Description |
Backup Start Time | Support selecting the default time (to perform backup during idle time of resources throughout the day) or customizing the backup start time. The backup will be initiated within this time range. If the backup fails to be initiated within this time period due to an unexpected reason, this backup will no longer start and will be initiated during the next backup start time period. Default time is the backup initiation time automatically assigned by the system. Support custom selection of backup start time. Set it to the off-peak period. Backup initiation time is merely the time when the backup starts and does not represent the backup end time. For example, if you select 02:00 - 06:00 to enable backup, the system will initiate backup at a certain point within the time range of 02:00 - 06:00, depending on the backend backup policy and backup system status. |
Weekly Backup | Select by the scale of one week, and support consecutive or interval selection from Monday to Sunday. Chosen by default for Monday to Sunday, 7 days. Support custom selection of backup time. However, to ensure the security of your data, please set up at least two backups per week. |
Weekly backup retention time | Weekly backup files can be retained for 7–1830 days. It defaults to 7 days. The backup set will be auto-deleted upon expiry. |
Monthly Backup | Select based on a one-month (31 days) scale. The backup data backed up monthly can be set with a separate retention time. Off by default. After turning on the switch, you can choose any number of days from 1 to 31. Particularly, if the 31st is selected, the backup this time will be skipped directly in months without the 31st. Monthly backup and weekly backup are carried out simultaneously, and all data will be stored. |
Monthly backup retention time | Monthly backup files can be retained for 7–1830 days. It defaults to 7 days. The backup set will be auto-deleted upon expiry. |
log backup retention time | Log backup data retention time setting: Retainable for 7–1830 days, defaults to 7 days. |

Last updated:2026-07-27 17:30:15
mkdir -p /var/lib/pgsql/16/recoverychown postgres /var/lib/pgsql/16/recovery
/var/lib/pgsql/12.[root@VM-10-5-tencentos postgresql-16.8]# wget -O /var/lib/pgsql/16/recovery/file_name.tar.zst "https://postgres-backup-gz-******.cos.ap-guangzhou.myqcloud.com/pgsql/1030559/data/20**-**-**/automatic-**********.tar.zst?q-sign-algorithm=sha1&q-ak=AKIDjHZcZJpqnqiL0jP4awHZg6McnqiYIwNZ&q-sign-time=1746776185%3B1746819385&q-key-time=1746776185%3B1746819385&q-header-list=host&q-url-param-list=&q-signature=68309d4bbc1bea30fef07776a2aa9fd699c19aa9"
[root@VM-10-5-tencentos postgresql-16.8]# ls -lh /var/lib/pgsql/16/recoverytotal 3952-rw-r--r-- 1 root root 4045802 May 7 20:42 manual-20250507204222.tar.zst
[root@VM-10-5-tencentos postgresql-16.8]# zstd --version*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
[root@VM-10-5-tencentos postgresql-16.8]# sudo yum install epel-release[root@VM-10-5-tencentos postgresql-16.8]# sudo yum install zstd
[root@VM-10-5-tencentos postgresql-16.8]# cd /var/lib/pgsql/16/recovery[root@VM-10-5-tencentos recovery]# tar -I zstd -xvf file_name.tar.zst
[root@VM-10-5-tencentos recovery]# ls -lhtotal 4.0M-rw------- 1 postgres postgres 225 May 7 20:42 backup_label-rw------- 1 postgres postgres 225 May 7 20:31 backup_label.olddrwx------ 6 postgres postgres 4.0K May 7 21:13 base-rw------- 1 postgres postgres 56 May 7 20:31 current_audit_logfiles-rw------- 1 postgres postgres 35 May 7 20:31 current_logfilesdrwx------ 2 postgres postgres 4.0K May 7 21:13 global-rw-r--r-- 1 root root 3.9M May 7 20:42 manual-20250507204222.tar.zstdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_commit_tsdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_dynshmem-rw------- 1 postgres postgres 308 May 7 20:31 pg_hba.conf-rw------- 1 postgres postgres 2.6K May 7 20:31 pg_ident.confdrwx------ 4 postgres postgres 4.0K May 7 20:31 pg_logicaldrwx------ 4 postgres postgres 4.0K May 7 20:31 pg_multixactdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_notifydrwx------ 2 postgres postgres 4.0K May 7 20:42 pg_replslotdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_serialdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_snapshotsdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_statdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_stat_tmpdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_subtransdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_tblspcdrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_twophase-rw------- 1 postgres postgres 3 May 7 20:31 PG_VERSIONdrwx------ 3 postgres postgres 4.0K May 7 21:13 pg_waldrwx------ 2 postgres postgres 4.0K May 7 20:31 pg_xact-rw------- 1 postgres postgres 3.2K May 7 20:31 postgresql.conf-rw------- 1 postgres postgres 0 May 7 20:31 standby.signal-rw------- 1 postgres postgres 0 May 7 20:42 tablespace_map-rw------- 1 postgres postgres. 2 May 7 20:31 TENCENTDB_RELEASE
[root@VM-10-5-tencentos recovery]# rm -rf backup_label
[root@VM-10-5-tencentos recovery]# vi postgresql.conf
pg_stat_statements.tracksynchronous_standby_namesextension_blacklistarchive_modebasebackup_exclude_pathstencentdb_syscache_max_numshared_preload_librariestencentdb_relcache_max_numarchive_commanddisable_dblink_connect_to_othertencentdb_az_fivetencentdb_az_fivetencentdb_relcache_evict_numpg_stat_statements.maxsoft_limit_connectionstencentdb_syscache_evict_numtencentdb_enable_trusted_extensionsynchronous_committencentdb_enable_superuser_unsafe_behaviourtencentdb_enable_copy_tolocal_preload_libraries
include = 'standby.conf'.log_destination = ‘csvlog’
port = '5433' ## Change the value of the port parameter to 5433.
synchronous_commit = localsynchronous_standby_names = ''
chmod 0700 /var/lib/pgsql/16/recoverychown postgres:postgres /var/lib/pgsql/16/recovery -R
[root@VM-10-5-tencentos recovery]# ls -altotal 4064drwx------ 19 postgres postgres 4096 May 8 09:43 .drwxr-xr-x 3 root root 4096 May 7 20:44 ..-rw------- 1 postgres postgres 225 May 7 20:42 backup_label-rw------- 1 postgres postgres 225 May 7 20:31 backup_label.olddrwx------ 6 postgres postgres 4096 May 7 21:13 base-rw------- 1 postgres postgres 56 May 7 20:31 current_audit_logfiles-rw------- 1 postgres postgres 35 May 7 20:31 current_logfilesdrwx------ 2 postgres postgres 4096 May 7 21:13 global-rw-r--r-- 1 postgres postgres 4045802 May 7 20:42 manual-20250507204222.tar.zstdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_commit_tsdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_dynshmem-rw------- 1 postgres postgres 308 May 7 20:31 pg_hba.conf-rw------- 1 postgres postgres 2640 May 7 20:31 pg_ident.confdrwx------ 4 postgres postgres 4096 May 7 20:31 pg_logicaldrwx------ 4 postgres postgres 4096 May 7 20:31 pg_multixactdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_notifydrwx------ 2 postgres postgres 4096 May 7 20:42 pg_replslotdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_serialdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_snapshotsdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_statdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_stat_tmpdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_subtransdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_tblspcdrwx------ 2 postgres postgres 4096 May 7 20:31 pg_twophase-rw------- 1 postgres postgres 3 May 7 20:31 PG_VERSIONdrwx------ 3 postgres postgres 4096 May 7 21:13 pg_waldrwx------ 2 postgres postgres 4096 May 7 20:31 pg_xact-rw------- 1 postgres postgres 3276 May 7 21:35 postgresql.conf-rw------- 1 postgres postgres 0 May 7 20:31 standby.signal-rw------- 1 postgres postgres 0 May 7 20:42 tablespace_map-rw------- 1 postgres postgres 2 May 7 20:31 TENCENTDB_RELEASE
[root@VM-10-5-tencentos postgresql-16.8]# wget -O /var/lib/pgsql/16/recovery/pg_wal/file_name.tar.zst "download_address"
[root@VM-10-5-tencentos recovery]# cd /var/lib/pgsql/16/recovery/pg_wal[root@VM-10-5-tencentos pg_wal]# ls -lhtotal 33M-rw------- 1 postgres postgres 16M May 7 20:42 000000010000000000000003-rw------- 1 postgres postgres 16M May 7 20:42 000000010000000000000004-rw-r--r-- 1 root root 1.5K May 8 10:31 20250508103101_20250508103101-20250508101527-000000010000000000000005_000000010000000000000005.tar.zstdrwx------ 2 postgres postgres 4.0K May 7 21:13 archive_status
[root@VM-10-5-tencentos pg_wal]# tar -I zstd -xvf file_name.tar.zst000000010000000000000005
[root@VM-10-5-tencentos pg_wal]# ls -lhtotal 49M-rw------- 1 postgres postgres 16M May 7 20:42 000000010000000000000003-rw------- 1 postgres postgres 16M May 7 20:42 000000010000000000000004-rw------- 1 1003 users 16M May 8 10:31 000000010000000000000005-rw-r--r-- 1 root root 1.5K May 8 10:31 20250508103101_20250508103101-20250508101527-000000010000000000000005_000000010000000000000005.tar.zstdrwx------ 2 postgres postgres 4.0K May 7 21:13 archive_status
/usr/local/pgsql/bin/pg_ctl start -D /var/lib/pgsql/16/recovery -l logfile
/usr/local/pgsql/bin/pg_ctl status -D /var/lib/pgsql/16/recovery

[postgres@VM-0-5-tencentos recovery]$ /usr/local/pgsql/bin/psql -h127.0.0.1 -p 5432 -Udbadmin -dpostgrespsql (16.0)Type "help" for help.postgres=>
[root@VM-10-5-tencentos ~]# pg_dump -h*.*.*.* -p 5432 -U dbadmin -Fc testdb > testdb_bkp.dumpPassword:
Parameter | Description |
host | The connection address of the TencentDB for PostgreSQL instance. If the cloud database and the CVM are in the same VPC, it is recommended to use the private network address for connection. |
port | The port of the TencentDB for PostgreSQL instance. |
username | The account name of the TencentDB for PostgreSQL instance. |
-Fc | Output format, which is suitable for pg_restore for restoration. |
dbname | The name of the database to be exported. |
dumpdir | The path and name of the exported backup file. |
[root@VM-10-5-tencentos ~]#ll testdb_bkp.dump
[postgres@VM-0-14-tencentos root]$ psql -h127.0.0.1 -p5432 -Upostgres -dpostgrespsql (16.0)Type "help" for help.postgres=# \duList of rolesRole name | Attributes-----------+------------------------------------------------------------postgres | Superuser, Create role, Create DB, Replication, Bypass RLSpostgres=# CREATE USER dbadmin WITH PASSWORD '123456' SUPERUSER;CREATE ROLEpostgres=# \duList of rolesRole name | Attributes-----------+------------------------------------------------------------dbadmin | Superuserpostgres | Superuser, Create role, Create DB, Replication, Bypass RLSpostgres=#
[postgres@VM-0-14-tencentos root]$ psql -h127.0.0.1 -p5432 -Udbadmin -dpostgrespsql (16.0)Type "help" for help.postgres=# select datname from pg_database;datname-----------template1template0postgres(3 rows)postgres=# create database testdb;CREATE DATABASEpostgres=# select datname from pg_database;datname-----------template1template0postgrestestdb(4 rows)postgres=#
Parameter | Description |
host | The connection address of the self-built PostgreSQL instance. |
port | The port of the self-built PostgreSQL instance. |
username | The account name of the self-built PostgreSQL instance. |
dbname | The name of the database to be imported. |
dumpdir | The path and name of the backup file to be imported. |
-c | -c is an optional parameter, indicating that the relevant data in the target database will be cleared before data restoration. |
pg_restore -h 127.0.0.1 -p 5432 -U dbadmin -d testdb testdb_bkp.dump -c
[postgres@VM-0-14-tencentos root]$ psql -h127.0.0.1 -p5432 -Udbadmin -dpostgrespsql (16.0)Type "help" for help.postgres=# \c testdbYou are now connected to database "testdb" as user "dbadmin".testdb=# SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';table_name------------sbtest1sbtest10sbtest2sbtest3sbtest4sbtest5sbtest6sbtest7sbtest8sbtest9(10 rows)testdb=#
Last updated:2025-08-14 16:41:45






Last updated:2026-03-31 17:16:23

Last updated:2025-08-14 16:46:26



Last updated:2024-03-20 15:43:50






Last updated:2026-03-31 11:43:04





Last updated:2025-07-22 20:25:30
Type | Source | Retention policy | Space Usage Cost | Recovery Operations | Delete Operation |
auto | Automatically generated by the system. | By default, backups are retained for 7 days from the generation time. Users can also customize the setting. For details, please refer to Automatic Backup Settings. | Recover by backup set or time point recovery. | If a backup set contains data within 2 days, it cannot be deleted. | |
Manual | Permanent retention. | Recover by backup set or time point recovery. | Self-service deletion. | ||
Final | The instance is automatically generated by the system when it is put into the recycle bin and completely cleared upon expiration. | Retention period: 8 days from generation time. | No charge. | Recover by backup set or time point recovery. | Non-deletable, can only be automatically cleared by the system upon expiration. |







Last updated:2026-05-15 10:27:13
CREATE EXTENSION [ IF NOT EXISTS ] extension_name[ WITH ][ SCHEMA schema_name ][ VERSION version ][ FROM old_version ]
\dxList of installed extensionsName | Version | Schema | Description---------------+---------+------------+---------------------------------------------------------------------amcheck | 1.2 | public | functions for verifying relation integritybloom | 1.0 | public | bloom access method - signature file based indexhstore | 1.6 | public | data type for storing sets of (key, value) pairshstore_plperl | 1.0 | public | transform between hstore and plperljsonb_plperl | 1.0 | public | transform between jsonb and plperlplperl | 1.0 | pg_catalog | PL/Perl procedural languageplpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagepostgis | 3.0.2 | public | PostGIS geometry, geography, and raster spatial types and functions(8 rows)
select * from pg_available_extensions where installed_version is not null; statement.name | default_version | installed_version | comment---------------+-----------------+-------------------+---------------------------------------------------------------------plperl | 1.0 | 1.0 | PL/Perl procedural languageamcheck | 1.2 | 1.2 | functions for verifying relation integrityhstore_plperl | 1.0 | 1.0 | transform between hstore and plperlplpgsql | 1.0 | 1.0 | PL/pgSQL procedural languagejsonb_plperl | 1.0 | 1.0 | transform between jsonb and plperlhstore | 1.6 | 1.6 | data type for storing sets of (key, value) pairsbloom | 1.0 | 1.0 | bloom access method - signature file based indexpostgis | 3.0.2 | 3.0.2 | PostGIS geometry, geography, and raster spatial types and functions(8 rows)
Last updated:2026-06-17 16:53:45
Range of Kernel Version | list of risk plugins |
less than or equal to v10.23_r1.24 | plv8,plls,plcoffee,pg_cron |
less than or equal to v11.22_r1.30 | plv8,plls,plcoffee,pg_cron |
less than or equal to v12.22_r1.33 | plv8,plls,plcoffee,pg_cron |
less than or equal to v13.22_r1.28 | plv8,plls,plcoffee,pg_cron |
less than or equal to v14.19_r1.37 | plv8,plls,plcoffee,pg_cron |
less than or equal to v15.14_r1.22 | plv8,plls,plcoffee,pg_cron |
less than or equal to v16.10_r1.17 | plv8,plls,plcoffee,pg_cron |
less than or equal to v17.6_r1.11 | plv8,plls,plcoffee,pg_cron |
less than or equal to v18.0_r1.1 | plv8,plls,plcoffee,pg_cron |
Last updated:2026-07-08 17:48:55
Plugin Name | v10 | v11 | v12 | v13 | v14 | v15 | v16 | v17 | v18 |
address_standardizer | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
address_standardizer_data_us | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
age | - | - | - | 1.5.0 | 1.5.0 | 1.5.0 | 1.5.0 | 1.5.0 | 1.7.0 |
auth_delay | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - |
auto_explain | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - |
autoinc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
bloom | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
bool_plperl | - | - | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
btree_gin | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
btree_gist | 1.5 | 1.5 | 1.5 | 1.5 | 1.6 | 1.7 | 1.7 | 1.7 | 1.8 |
chkpass | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
citext | 1.4 | 1.5 | 1.6 | 1.6 | 1.6 | 1.6 | 1.6 | 1.6 | 1.8 |
cos_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
count_distinct | - | 3.0.2 | 3.0.2 | 3.0.2 | 3.0.2 | 3.0.2 | 3.0.2 | 3.0.2 | 3.0.2 |
cube | 1.2 | 1.4 | 1.4 | 1.4 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
decoder_raw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - |
decoderbufs | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 | 0.1.0 |
dict_int | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
dict_xsyn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 |
fuzzystrmatch | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 |
hll | 2.14 | 2.14 | 2.14 | 2.15 | 2.16 | 2.16 | 2.18 | 2.18 | 2.18 |
hstore | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.8 | 1.8 | 1.8 | 1.8 |
hstore_plperl | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
hypopg | - | 1.4.1 | 1.4.1 | 1.4.1 | 1.4.1 | 1.4.1 | 1.4.1 | 1.4.1 | 1.4.1 |
imgsmlr | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
insert_username | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
intarray | 1.2 | 1.2 | 1.2 | 1.3 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
isn | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.3 |
jsonb_plperl | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
lo | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 |
ltree | 1.1 | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.3 | 1.3 |
moddatetime | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
mysql_fdw | 1.0 | 1.0 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 |
old_snapshot | - | - | - | - | 1.0 | 1.0 | 1.0 | - | - |
orafce | - | - | 3.8 | - | 4.15 | 4.16 | 4.16 | - | - |
pg_bigm | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | - |
pg_buffercache | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.4 | 1.5 | 1.6 |
pg_freespacemap | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.3 |
pg_graphql | - | - | - | - | - | - | - | 1.6.1 | - |
pg_hashids | 1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
pg_hint_plan | 1.3.6 | 1.3.6 | 1.3.6 | 1.3.7 | 1.4.1 | 1.4.1 | 1.6.0 | 1.7.0 | 1.8.0 |
pg_ivm | - | - | - | 1.11 | 1.11 | 1.11 | 1.11 | 1.11 | 1.11 |
pg_jieba | - | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 | 1.1.1 |
pg_jsonschema | - | - | - | - | - | - | - | 0.3.4 | - |
pg_partman | - | 4.7.3 | 4.7.3 | 4.7.4 | 4.7.4 | 4.7.4 | 5.1.0 | 4.7.4 | 4.7.4 |
pg_pathman | - | 1.5 | 1.5 | 1.5 | - | - | - | - | - |
pg_prewarm | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
pg_repack | 1.4.4 | 1.5.2 | 1.5.2 | 1.5.2 | 1.5.2 | 1.5.2 | 1.5.2 | 1.5.2 | 1.5.2 |
pg_savior | - | - | - | - | - | - | - | 0.1.0 | 0.1.0 |
pg_similarity | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
pg_sphere | - | 1.5.1 | 1.5.1 | 1.5.1 | 1.5.1 | 1.5.1 | 1.5.1 | 1.5.1 | 1.5.1 |
pg_stat_error | 1.0 | 1.0 | 1.0 | 1.0 | - | - | - | - | - |
pg_stat_log | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
pg_stat_monitor | - | - | - | - | - | - | - | 2.4.0 | - |
pg_stat_statements | 1.6 | 1.6 | 1.7 | 1.8 | 1.9 | 1.10 | 1.10 | 1.11 | 1.12 |
pg_textsearch | - | - | - | - | - | - | - | 1.3.1 | 1.3.1 |
pg_trgm | 1.3 | 1.4 | 1.4 | 1.5 | 1.6 | 1.6 | 1.6 | 1.6 | 1.6 |
pg_visibility | 1.2 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 |
pgagent | 4.0 | 4.0 | 4.0 | 4.2.3 | 4.2.3 | 4.2.3 | 4.2.3 | 4.2.3 | 4.2 |
pgaudit | - | 1.3.4 | 1.7 | 1.7 | 1.7 | 1.7 | 1.7 | 17.0 | 17.0 |
pgcrypto | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.4 |
pgjwt | - | - | - | - | - | - | - | 0.2.0 | - |
pglogical | - | 2.4.4 | 2.4.4 | 2.4.4 | 2.4.4 | 2.4.4 | 2.4.4 | 2.4.5 | 2.4.7 |
pglogical_origin | - | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | - | 1.0.0 |
pgmq | - | - | - | - | - | - | - | 1.11.1 | 1.11.1 |
pgroonga | - | - | - | - | - | - | - | 4.0.6 | - |
pgroonga_database | - | - | - | - | - | - | - | 4.0.6 | - |
pgrouting | 3.2.2 | 3.2.2 | 3.2.2 | 3.2.2 | 3.2.2 | 3.2.2 | 3.5.1 | 3.6.2 | 3.6.2 |
pgrowlocks | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
pgsodium | - | - | - | - | - | - | - | 3.1.12 | - |
pgstattuple | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
pgtap | - | - | - | - | - | - | - | 1.3.4 | - |
pipelinedb | 1.0.0 | 1.0.0 | - | - | - | - | - | - | - |
pldbgapi | - | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
plperl | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
plpgsql | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
plpgsql_check | - | - | - | - | - | - | - | 2.9 | - |
postgis | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
postgis_raster | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
postgis_sfcgal | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
postgis_tiger_geocoder | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
postgis_topology | 3.0.1 | 3.0.1 | 3.0.2 | 3.0.2 | 3.2.1 | 3.3.2 | 3.4.0 | 3.5.0 | 3.5.3 |
postgres_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 |
rdkit | 3.8 | 3.8 | 3.8 | 3.8 | 4.0.1 | 4.0.1 | 4.0.1 | 4.5.0 | 4.7.0 |
rds_extension_list | - | - | - | - | - | - | - | - | - |
rds_server_handler | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
refint | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
roaringbitmap | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 |
rum | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
seg | 1.1 | 1.3 | 1.3 | 1.3 | 1.4 | 1.4 | 1.4 | 1.4 | 1.4 |
sequential_uuids | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 |
smlar | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - |
sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
starrocks_fdw | - | - | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.2 |
supabase_vault | - | - | - | - | - | - | - | 0.3.1 | - |
tablefunc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tcn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tencentdb_ai | - | - | - | - | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
tencentdb_failover_slot | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - | 1.0 |
tencentdb_polaris | - | - | - | - | - | - | - | 1 | - |
tencentdb_proxy_funcs | - | - | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
tencentdb_pwdcheck | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - |
tencentdb_regex | - | - | - | - | - | - | - | - | 1 |
tencentdb_scf | - | - | - | - | - | - | - | 1 | - |
tencentdb_serverless | - | - | - | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tencentdb_sql_throttling | - | - | - | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tencentdb_stat | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | - | - | - | - |
tencentdb_sublink | - | - | - | - | - | - | - | - | 1 |
tencentdb_superuser | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.1 |
tencentdb_system_stat | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tencentdb_wal_stat | - | - | - | - | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
timescaledb | 1.7.5 | 1.7.5 | 2.6.0 | 2.19.0 | 2.19.0 | 2.23.0 | 2.23.0 | 2.23.0 | 2.23.0 |
timetravel | 1.0 | 1.0 | - | - | - | - | - | - | - |
topn | 2.4.0 | 2.4.0 | 2.4.0 | 2.4.0 | 2.4.0 | 2.4.0 | 2.6.0 | 2.6.0 | 2.6.0 |
tsm_system_rows | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
tsm_system_time | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
uuid-ossp | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
vector | - | - | 0.7.3 | 0.8.2 | 0.8.2 | 0.8.2 | 0.8.2 | 0.8.2 | 0.8.2 |
vectorscale | - | - | - | - | 0.9.0 | 0.9.0 | 0.9.0 | 0.9.0 | 0.9.0 |
wal2json | 2.3 | 2.3 | 2.3 | 2.3 | 2.3 | 2.3 | 2.5 | 2.6 | - |
xml2 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 |
zhparser | 1.0 | 1.0 | 2.2 | 1.0 | 2.2 | 2.2 | 2.2 | 2.2 | 2.2 |
Last updated:2024-01-24 11:16:51
Extension | v9.3.25_r1.3 | v9.3.25_r1.2 | v9.3.25_r1.1 | v9.3.5_r1.0 |
pg_hint_plan | 1.1.4 | 1.1.4 | 1.1.4 | 1.1.4 |
pg_prewarm | Unsupported | Unsupported | Unsupported | Unsupported |
pg_stat_error | 1 | 1 | 1 | 1 |
pg_stat_log | 1 | 1 | 1 | 1 |
pg_stat_statements | 1.1 | 1.1 | 1.1 | 1.1 |
pgrowlocks | 1.1 | 1.1 | 1.1 | 1.1 |
sslinfo | 1 | 1 | 1 | 1 |
tablefunc | 1 | 1 | 1 | 1 |
tcn | 1 | 1 | 1 | 1 |
unaccent | 1 | 1 | 1 | 1 |
uuid-ossp | 1 | 1 | 1 | 1 |
pg_cron | Unsupported | Unsupported | Unsupported | Unsupported |
pgagent | 4 | 4 | 4 | 4 |
pg_partman | Unsupported | Unsupported | Unsupported | Unsupported |
tsearch2 | 1 | 1 | 1 | 1 |
postgis | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
postgis_raster | Unsupported | Unsupported | Unsupported | Unsupported |
postgis_sfcgal | 2.3.0 | 2.3.0 | 2.3.0 | Unsupported |
postgis_tiger_geocoder | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
postgis_topology | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
pgrouting | 2.4.1 | 2.4.1 | 2.4.1 | 2.4.1 |
address_standardizer | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
address_standardizer_data_us | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
earthdistance | 1 | 1 | 1 | 1 |
plperl | 1 | 1 | 1 | 1 |
plpgsql | 1 | 1 | 1 | 1 |
pltcl | 1 | 1 | 1 | 1 |
plv8 | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
bool_plperl | Unsupported | Unsupported | Unsupported | Unsupported |
jsonb_plperl | Unsupported | Unsupported | Unsupported | Unsupported |
hstore | 1.2 | 1.2 | 1.2 | 1.2 |
hstore_plperl | Unsupported | Unsupported | Unsupported | Unsupported |
plcoffee | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
plls | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
timescaledb | Unsupported | Unsupported | Unsupported | Unsupported |
pipelinedb | Unsupported | Unsupported | Unsupported | Unsupported |
rdkit | Unsupported | Unsupported | Unsupported | Unsupported |
imgsmlr | 1 | 1 | 1 | 1 |
zhparser | 1 | 1 | 1 | 1 |
intagg | 1 | 1 | 1 | 1 |
intarray | 1 | 1 | 1 | 1 |
isn | 1 | 1 | 1 | 1 |
xml2 | 1 | 1 | 1 | 1 |
jsonbx | Unsupported | Unsupported | Unsupported | Unsupported |
dict_int | 1 | 1 | 1 | 1 |
dict_xsyn | 1 | 1 | 1 | 1 |
citext | 1 | 1 | 1 | 1 |
ltree | 1 | 1 | 1 | 1 |
postgres_fdw | 1 | 1 | 1 | 1 |
orafce | 3.3 | 3.3 | 3.3 | 3.3 |
chkpass | 1 | 1 | 1 | 1 |
bloom | Unsupported | Unsupported | Unsupported | Unsupported |
btree_gin | 1 | 1 | 1 | 1 |
btree_gist | 1 | 1 | 1 | 1 |
roaringbitmap | Unsupported | Unsupported | Unsupported | Unsupported |
rum | Unsupported | Unsupported | Unsupported | Unsupported |
cube | 1 | 1 | 1 | 1 |
decoderbufs | Unsupported | Unsupported | Unsupported | Unsupported |
pg_bigm | Unsupported | Unsupported | Unsupported | Unsupported |
fuzzystrmatch | 1 | 1 | 1 | 1 |
hll | Unsupported | Unsupported | Unsupported | Unsupported |
pg_trgm | 1.1 | 1.1 | 1.1 | 1.1 |
pg_hashids | 1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 |
pgcrypto | 1 | 1 | 1 | 1 |
cos_fdw | Unsupported | Unsupported | Unsupported | Unsupported |
topn | Unsupported | Unsupported | Unsupported | Unsupported |
Last updated:2024-01-24 11:16:51
Extension | v9.5.25_r1.3 | v9.5.25_r1.2 | v9.5.25_r1.1 | v9.5.4_r1.0 |
pg_hint_plan | 1.1.5 | 1.1.5 | 1.1.5 | 1.1.5 |
pg_prewarm | 1 | 1 | 1 | Unsupported |
pg_stat_error | 1 | 1 | 1 | 1 |
pg_stat_log | 1 | 1 | 1 | 1 |
pg_stat_statements | 1.3 | 1.3 | 1.3 | 1.3 |
pgrowlocks | 1.1 | 1.1 | 1.1 | 1.1 |
sslinfo | 1 | 1 | 1 | 1 |
tablefunc | 1 | 1 | 1 | 1 |
tcn | 1 | 1 | 1 | 1 |
unaccent | 1 | 1 | 1 | 1 |
uuid-ossp | 1 | 1 | 1 | 1 |
pg_cron | 1.1 | 1.1 | 1.1 | 1.1 |
pgagent | 1.2 | 1.2 | 1.2 | 4 |
pg_partman | 2.6.4, 1.4 | 2.6.4, 1.4 | 2.6.4, 1.4 | 2.6.4, 1.4, 1.0 |
tsearch2 | 1 | 1 | 1 | 1 |
postgis | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
postgis_raster | Unsupported | Unsupported | Unsupported | Unsupported |
postgis_sfcgal | 2.3.0 | 2.3.0 | 2.3.0 | Unsupported |
postgis_tiger_geocoder | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
postgis_topology | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
pgrouting | 2.4.1 | 2.4.1 | 2.4.1 | 2.4.1 |
address_standardizer | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
address_standardizer_data_us | 2.3.0 | 2.3.0 | 2.3.0 | 2.3.0 |
earthdistance | 1 | 1 | 1 | 1 |
plperl | 1 | 1 | 1 | 1 |
plpgsql | 1 | 1 | 1 | 1 |
pltcl | 1 | 1 | 1 | 1 |
plv8 | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
bool_plperl | Unsupported | Unsupported | Unsupported | Unsupported |
jsonb_plperl | Unsupported | Unsupported | Unsupported | Unsupported |
hstore | 1.3 | 1.3 | 1.3 | 1.3 |
hstore_plperl | 1 | 1 | 1 | 1 |
plcoffee | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
plls | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 |
timescaledb | Unsupported | Unsupported | Unsupported | Unsupported |
pipelinedb | Unsupported | Unsupported | Unsupported | Unsupported |
rdkit | Unsupported | Unsupported | Unsupported | Unsupported |
imgsmlr | 1 | 1 | 1 | 1 |
zhparser | 1 | 1 | 1 | 1 |
intagg | 1 | 1 | 1 | 1 |
intarray | 1 | 1 | 1 | 1 |
isn | 1 | 1 | 1 | 1 |
xml2 | 1 | 1 | 1 | 1 |
jsonbx | 1 | 1 | 1 | 1 |
dict_int | 1 | 1 | 1 | 1 |
dict_xsyn | 1 | 1 | 1 | 1 |
citext | 1.1 | 1.1 | 1.1 | 1.1 |
ltree | 1 | 1 | 1 | 1 |
postgres_fdw | 1 | 1 | 1 | 1 |
orafce | 3.3 | 3.3 | 3.3 | 3.3 |
chkpass | 1 | 1 | 1 | 1 |
bloom | Unsupported | Unsupported | Unsupported | Unsupported |
btree_gin | 1 | 1 | 1 | 1 |
btree_gist | 1.1 | 1.1 | 1.1 | 1.1 |
roaringbitmap | Unsupported | Unsupported | Unsupported | Unsupported |
rum | Unsupported | Unsupported | Unsupported | Unsupported |
cube | 1 | 1 | 1 | 1 |
decoderbufs | Unsupported | Unsupported | Unsupported | Unsupported |
pg_bigm | 1.2 | 1.2 | 1.2 | 1.2 |
fuzzystrmatch | 1 | 1 | 1 | 1 |
hll | 2.14 | 2.14 | 2.14 | 2.14 |
pg_trgm | 1.1 | 1.1 | 1.1 | 1.1 |
pg_hashids | 1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 |
pgcrypto | 1.2 | 1.2 | 1.2 | 1.2 |
cos_fdw | Unsupported | Unsupported | Unsupported | Unsupported |
topn | Unsupported | Unsupported | Unsupported | Unsupported |
Last updated:2025-08-14 17:04:48
SELECT * FROM pg_available_extensions WHERE name = 'vector';





CREATE EXTENSION vector;
SELECT * FROM pg_available_extensions WHERE name = 'vector';

Last updated:2026-06-17 16:51:12
pg_roaringbitmap extension to use the bitwise operation feature to improve the query performance.CREATE EXTENSION roaringbitmap;
roaringbitmap type:CREATE TABLE t1 (id integer, bitmap roaringbitmap);
rb_build function to insert the roaringbitmap data:-- Set the bit value of the array to 1.INSERT INTO t1 SELECT 1,RB_BUILD(ARRAY[1,2,3,4,5,6,7,8,9,200]);-- Set the bit values of multiple records to 1 and aggregate the bit values into a Roaring bitmap.INSERT INTO t1 SELECT 2,RB_BUILD_AGG(e) FROM GENERATE_SERIES(1,100) e;
-- Set the bit value of the array to 1.SELECT RB_OR(a.bitmap,b.bitmap) FROM (SELECT bitmap FROM t1 WHERE id = 1) AS a,(SELECT bitmap FROM t1 WHERE id = 2) AS b;
SELECT RB_OR_AGG(bitmap) FROM t1;SELECT RB_AND_AGG(bitmap) FROM t1;SELECT RB_XOR_AGG(bitmap) FROM t1;SELECT RB_BUILD_AGG(e) FROM GENERATE_SERIES(1,100) e;
SELECT RB_CARDINALITY(bitmap) FROM t1;
SELECT RB_ITERATE(bitmap) FROM t1 WHERE id = 1;
Function | Input | Output | Description | Example | Result |
rb_build | integer[] | roaringbitmap | Create roaringbitmap from integer array | rb_build('{1,2,3,4,5}') | {1,2,3,4,5} |
rb_index | roaringbitmap,integer | bigint | Return the 0-based index of element in this roaringbitmap, or -1 if do not exsits | rb_index('{1,2,3}',3) | 2 |
rb_cardinality | roaringbitmap | bigint | Return cardinality of the roaringbitmap | rb_cardinality('{1,2,3,4,5}') | 5 |
rb_and_cardinality | roaringbitmap,roaringbitmap | bigint | Return cardinality of the AND of two roaringbitmaps | rb_or_cardinality('{1,2,3}','{3,4,5}') | 1 |
rb_xor_cardinality | roaringbitmap,roaringbitmap | bigint | Return cardinality of the XOR of two roaringbitmaps | rb_xor_cardinality('{1,2,3}','{3,4,5}') | 4 |
rb_andnot_cardinality | roaringbitmap,roaringbitmap | bigint | Return cardinality of the ANDNOT of two roaringbitmaps | rb_andnot_cardinality('{1,2,3}','{3,4,5}') | 2 |
rb_is_empty | roaringbitmap | boolean | Check if roaringbitmap is empty. | rb_is_empty('{1,2,3,4,5}') | t |
rb_fill | roaringbitmap,range_start bigint,range_end bigint | roaringbitmap | Fill the specified range (not include the range_end) | rb_fill('{1,2,3}',5,7) | {1,2,3,5,6} |
rb_clear | roaringbitmap,range_start bigint,range_end bigint | roaringbitmap | Clear the specified range (not include the range_end) | rb_clear('{1,2,3}',2,3) | {1,3} |
rb_flip | roaringbitmap,range_start bigint,range_end bigint | roaringbitmap | Negative the specified range (not include the range_end) | rb_flip('{1,2,3}',2,10) | {1,4,5,6,7,8,9} |
rb_range | roaringbitmap,range_start bigint,range_end bigint | roaringbitmap | Return new set with specified range (not include the range_end) | rb_range('{1,2,3}',2,3) | {2} |
rb_range_cardinality | roaringbitmap,range_start bigint,range_end bigint | bigint | Return the cardinality of specified range (not include the range_end) | rb_range_cardinality('{1,2,3}',2,3) | 1 |
rb_min | roaringbitmap | integer | Return the smallest offset in roaringbitmap. Return NULL if the bitmap is empty | rb_min('{1,2,3}') | 1 |
rb_max | roaringbitmap | integer | Return the greatest offset in roaringbitmap. Return NULL if the bitmap is empty | rb_max('{1,2,3}') | 3 |
rb_rank | roaringbitmap,integer | bigint | Return the number of elements that are smaller or equal to the specified offset | rb_rank('{1,2,3}',3) | 3 |
rb_jaccard_dist | roaringbitmap,roaringbitmap | double precision | Return the jaccard distance(or the Jaccard similarity coefficient) of two bitmaps | rb_jaccard_dist('{1,2,3}','{3,4}') | 0.25 |
rb_select | roaringbitmap,bitset_limit bigint,bitset_offset bigint=0,reverse boolean=false,range_start bigint=0,range_end bigint=4294967296 | roaringbitmap | Return subset [bitset_offset,bitset_offset+bitset_limit) of bitmap between range [range_start,range_end) | rb_select('{1,2,3,4,5,6,7,8,9}',5,2) | {3,4,5,6,7} |
rb_to_array | roaringbitmap | integer[] | Convert roaringbitmap to integer array | rb_to_array(roaringbitmap('{1,2,3}')) | {1,2,3} |
rb_iterate | roaringbitmap | SET of integer | Return set of integer from a roaringbitmap data. | SELECT rb_iterate(rb_build('{1,2,3}')) | 1 2 3 |
Aggregate Function | Input | Output | Description | Example | Result |
rb_build_agg | integer | roaringbitmap | Build a roaringbitmap from a integer set | select rb_build_agg(id) from (values (1),(2),(3)) t(id) | {1,2,3} |
rb_or_agg | roaringbitmap | roaringbitmap | AND Aggregate calculations from a roaringbitmap set | select rb_or_agg(bitmap) from (values (roaringbitmap('{1,2,3}')), (roaringbitmap('{2,3,4}')) ) t(bitmap) | {1,2,3,4} |
rb_and_agg | roaringbitmap | roaringbitmap | AND Aggregate calculations from a roaringbitmap set | select rb_and_agg(bitmap) from (values (roaringbitmap('{1,2,3}')), (roaringbitmap('{2,3,4}')) ) t(bitmap) | {2,3} |
rb_xor_agg | roaringbitmap | roaringbitmap | XOR Aggregate calculations from a roaringbitmap set | select rb_xor_agg(bitmap) from (values (roaringbitmap('{1,2,3}')), (roaringbitmap('{2,3,4}')) ) t(bitmap) | |
rb_or_cardinality_agg | roaringbitmap | bigint | OR Aggregate calculations from a roaringbitmap set, return cardinality. | select rb_or_cardinality_agg(bitmap) from (values (roaringbitmap('{1,2,3}')),(roaringbitmap('{2,3,4}'))) t(bitmap) | 4 |
rb_and_cardinality_agg | roaringbitmap | bigint | AND Aggregate calculations from a roaringbitmap set, return cardinality | select rb_and_cardinality_agg(bitmap) from (values (roaringbitmap('{1,2,3}')), (roaringbitmap('{2,3,4}'))) t(bitmap) | 2 |
rb_xor_cardinality_agg | roaringbitmap | bigint | XOR Aggregate calculations from a roaringbitmap set, return cardinality | select rb_xor_cardinality_agg(bitmap) from (values (roaringbitmap('{1,2,3}')), (roaringbitmap('{2,3,4}')) ) t(bitmap) | 2 |
Last updated:2026-08-14 18:02:38
| Method 1: Direct Registration of Hunyuan Model | Method 2: Registration via TokenHub |
Authentication Method | SecretId + SecretKey (TC3 signature) | api_key(Bearer Token) |
Backend Type | backend_type = 'hunyuan' | backend_type = 'tokenhub' |
Use Cases | Already have the SecretId/SecretKey for the Hunyuan model. | Already migrated to the TokenHub platform for unified API Key management. |
Model Example | hunyuan-embedding (1024 dimensions) | kinfra-text-embedding-0.6b (1024 dimensions) |
Credential Required or Not | Requires Hunyuan key. | Requires a TokenHub API Key. |
Tested in Current Environment | Passed. | Passed. |
auto model (backend_type=tokenhub) pre-installed in the environment is used for ChatCompletions (LLM conversation) and does not support Embedding. To use TokenHub for automatic vectorization, you must register an embedding model separately using Method 2.SELECT name, default_version, commentFROM pg_available_extensionsWHERE name IN ('tencentdb_ai', 'pgvector', 'pgmq', 'vector');
name | default_version | installed_version | comment--------------+-----------------+-------------------+----------------------------------------------------------------tencentdb_ai | 1.6 | | tencentdb_ai is an ai extension that allows your database to integrate AI capabilities, such as promt, embedding, etc.pgmq | 1.11.1 | | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.vector | 0.8.2 | | vector data type and ivfflat and hnsw access methods(3 rows)
SHOW shared_preload_libraries;
shared_preload_libraries-----------------------------------------------------------------------------------------------------------------------------------------pg_stat_statements,pg_stat_log,wal2json,decoderbufs,decoder_raw,pg_hint_plan,rds_server_handler,tencentdb_pwdcheck,auto_explain,pgaudit,tencentdb_ai(1 row)
tencentdb_ai is already in shared_preload_libraries, at the last position.SELECT name, setting, contextFROM pg_settingsWHERE name LIKE 'tencentdb_ai.autoembedding%'ORDER BY name;
name | setting | context--------------------------------------------------+----------+---------tencentdb_ai.autoembedding_batch_size | 32 | sighuptencentdb_ai.autoembedding_database | postgres | sighuptencentdb_ai.autoembedding_max_input_bytes | 65536 | sighuptencentdb_ai.autoembedding_max_retry | 5 | sighuptencentdb_ai.autoembedding_naptime_ms | 5000 | sighuptencentdb_ai.autoembedding_retry_base_ms | 1000 | sighuptencentdb_ai.autoembedding_task_launch_jitter_ms | 10 | sighuptencentdb_ai.autoembedding_worker | on | sighup(8 rows)
autoembedding_database = postgres and autoembedding_worker = on are all reasonable.-- pgcrypto, vector, and pgmq are installed automatically.CREATE EXTENSION IF NOT EXISTS tencentdb_ai CASCADE;
NOTICE: installing required extension "pgcrypto"NOTICE: installing required extension "vector"NOTICE: installing required extension "pgmq"WARNING: change unlogged table to logged table, If you want to use unlogged tables, please set tencentdb_log_unlogged_table to false.CREATE EXTENSION
SELECT * FROM pgmq.list_queues();
queue_name | is_partitioned | is_unlogged | created_at-------------------------------------+----------------+-------------+-------------------------------tencentdb_ai_autoembedding_incr | f | f | 2026-08-05 22:36:41.689961+08tencentdb_ai_autoembedding_backfill | f | f | 2026-08-05 22:36:41.689961+08(2 rows)
tencentdb_ai_autoembedding_incr (incremental) and tencentdb_ai_autoembedding_backfill (backfill).-- View the structure of the model_list table.SELECT column_name, data_type FROM information_schema.columnsWHERE table_schema = 'tencentdb_ai' AND table_name = 'model_list'ORDER BY ordinal_position;-- View existing models.SELECT * FROM tencentdb_ai.model_list;
column_name | data_type-----------------+-----------model_name | namejson_path | jsonpathsecretid | byteasecretkey | byteaversion | textregion | textid_random | integerkey_random | integerbackend_type | textreal_model_name | nameapi_key | byteaapi_key_random | integerembedding_dim | integer(13 rows)model_name | json_path | secretid | secretkey | version | region | id_random | key_random | backend_type | real_model_name | api_key | api_key_random | embedding_dim------------+------------------------------------+----------+-----------+---------+--------+-----------+------------+--------------+-----------------+---------+----------------+---------------auto | $."choices"[0]."message"."content" | | | | | | | tokenhub | auto | | |(1 row)
auto model (tokenhub backend, for ChatCompletions, not for Embedding) is available. You need to register the Hunyuan Embedding-specific model.-- Register a model. (The last parameter, backend_type, has a default value of 'hunyuan' and can be omitted.)SELECT tencentdb_ai.add_model('hunyuan-embedding', '2023-09-01', NULL, NULL);-- [Enter the SecretId here]SELECT tencentdb_ai.update_model_attr('hunyuan-embedding','SecretId','<your_SecretId>' -- Replace with your SecretId);-- [Enter the SecretKey here]SELECT tencentdb_ai.update_model_attr('hunyuan-embedding','SecretKey','<your_SecretKey>' -- Replace with your SecretKey);-- Set the embedding vector dimension.UPDATE tencentdb_ai.model_listSET embedding_dim = 1024WHERE model_name = 'hunyuan-embedding';-- Verify the model configuration.SELECT model_name, backend_type, embedding_dimFROM tencentdb_ai.model_listWHERE model_name = 'hunyuan-embedding';
add_model-----------(1 row)update_model_attr-------------------(1 row)update_model_attr-------------------(1 row)UPDATE 1model_name | backend_type | embedding_dim-------------------+--------------+---------------hunyuan-embedding | hunyuan | 1024(1 row)
backend_type = hunyuan and embedding_dim = 1024.-- Create a table. (A single-column primary key is required.)DROP TABLE IF EXISTS kb_articles CASCADE;CREATE TABLE kb_articles (id bigserial PRIMARY KEY,title text,content text);-- Insert test data.INSERT INTO kb_articles (title, content) VALUES('PostgreSQL Introduction','PostgreSQL is a powerful, open-source, object-relational database system. Through over 30 years of active development, it has earned a strong reputation for reliability, feature robustness, and performance.'),('Tencent Cloud VectorDB','Tencent Cloud VectorDB is a type of database system specifically designed for storing and searching high-dimensional vectors. It enables AI applications such as semantic search, recommendation systems, and RAG through vector similarity calculations.'),('RAG Technology','Retrieval-Augmented Generation (RAG) is an AI technology that combines retrieval and generation capabilities. It enhances the response quality of large language models by retrieving relevant information from a knowledge base.'),-- Verify the write operation.SELECT 'Test data inserted: ' || count(*)::text FROM kb_articles;
NOTICE: table "kb_articles" does not exist, skippingDROP TABLECREATE TABLEINSERT 0 3?column?-----------------------Test data inserted: 3(1 row)
-- 5.1 Create an incremental task.-- Automatically create a content_embedding vector(1024) column.-- Automatically create INSERT AFTER + UPDATE BEFORE triggers.SELECT tencentdb_ai.add_incr_autoembedding_task('public', 'kb_articles',ARRAY['content'],'hunyuan-embedding') AS incr_task_id;-- 5.2 Create a stock task (backfill historical data).SELECT tencentdb_ai.add_backfill_autoembedding_task('public', 'kb_articles',ARRAY['content'],'hunyuan-embedding') AS backfill_task_id;
incr_task_id--------------1(1 row)backfill_task_id------------------1(1 row)
\d kb_articles
Table "public.kb_articles"Column | Type | Collation | Nullable | Default-------------------+--------------+-----------+----------+-----------------------------------------id | bigint | | not null | nextval('kb_articles_id_seq'::regclass)title | text | | |content | text | | |content_embedding | vector(1024) | | |Indexes:"kb_articles_pkey" PRIMARY KEY, btree (id)Triggers:tencentdb_ai_autoemb_ins_1 AFTER INSERT ON kb_articles FOR EACH ROWEXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger(...)tencentdb_ai_autoemb_upd_1 BEFORE UPDATE OF content ON kb_articles FOR EACH ROWEXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger(...)
add_incr_autoembedding_task automatically created a content_embedding vector(1024) column and two triggers.SELECT trigger_name, event_manipulation, action_statementFROM information_schema.triggersWHERE event_object_table = 'kb_articles';
trigger_name | event_manipulation | action_statement----------------------------+--------------------+------------------------------------------------------------------------------------------------------------------------tencentdb_ai_autoemb_ins_1 | INSERT | EXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger('1', '17136', 'content_embedding', 'content', '{}', 'id')tencentdb_ai_autoemb_upd_1 | UPDATE | EXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger('1', '17136', 'content_embedding', 'content', '{}', 'id')(2 rows)
SELECT task_kind, task_id, table_name, target_column, status, backfill_state, pending, failed_countFROM tencentdb_ai.autoembedding_statusORDER BY task_id;
task_kind | task_id | table_name | target_column | status | backfill_state | pending | failed_count-----------+---------+-------------+-------------------+---------+----------------+---------+--------------incr | 1 | kb_articles | content_embedding | enabled | | 0 | 0backfill | 1 | kb_articles | content_embedding | | not_started | 0 | 0(2 rows)
backfill_state = not_started was not started automatically (see the Bug section).SELECT table_name, relid, status FROM tencentdb_ai.autoembedding_incr_task;
table_name | relid | status-------------+-------+---------kb_articles | 17136 | enabled(1 row)
enabled, and relid = 17136.-- Insert new data (insert after the incremental task is created).INSERT INTO kb_articles (title, content) VALUES('Embedding Model', 'An embedding model is a machine learning model that converts text into vector representations. Common embedding models include BERT, GPT, and Hunyuan Embedding, among others.');
INSERT 0 1
-- Check the pending status immediately. (You should see pending = 1, indicating that it has been enqueued.)SELECT task_kind, pending FROM tencentdb_ai.autoembedding_status;
task_kind | pending-----------+---------incr | 1backfill | 0(2 rows)
pending = 1 and the message has been enqueued.-- Wait for the background worker to process.SELECT pg_sleep(5);
pg_sleep----------(1 row)
-- Check whether vectors have been generated. (Note: The first 3 rows existed before the task was created and will not be backfilled automatically.)SELECT id, title,content_embedding IS NOT NULL AS has_embedding,CASE WHEN content_embedding IS NOT NULLTHEN vector_dims(content_embedding) ELSE NULL END AS dimsFROM kb_articlesORDER BY id;
id | title | has_embedding | dims----+-----------------+---------------+------1 | PostgreSQL Introduction | f |2 | Tencent Cloud VectorDB | f |3 | RAG Technology | f |4 | Embedding Model | t |(4 rows)
INSERT INTO kb_articles (title, content) VALUES('Hunyuan Large Model', 'Tencent Hunyuan is a general-purpose large language model self-developed by Tencent, featuring powerful natural language understanding and generation capabilities.');
INSERT 0 1
-- Check the pending status immediately.SELECT task_kind, pending FROM tencentdb_ai.autoembedding_status;
task_kind | pending-----------+---------incr | 1backfill | 0(2 rows)
SELECT pg_sleep(5);SELECT task_kind, pending, failed_count FROM tencentdb_ai.autoembedding_status;SELECT id, title, content_embedding IS NOT NULL AS has_embeddingFROM kb_articles ORDER BY id;-- Error TableSELECT * FROM tencentdb_ai.autoembedding_error ORDER BY created_at DESC LIMIT 5;
pg_sleep----------(1 row)task_kind | pending | failed_count-----------+---------+--------------incr | 0 | 0backfill | 0 | 0(2 rows)id | title | has_embedding----+-----------------+---------------1 | PostgreSQL Introduction | f2 | Tencent Cloud VectorDB | f3 | RAG Technology | f4 | Embedding Model | t5 | Hunyuan Large Model | t(5 rows)error_id | msg_id | task_kind | task_id | row_id | error_code | error_message | detail | created_at----------+--------+-----------+---------+--------+------------+---------------+--------+------------(0 rows)
pending = 0, failed_count = 0, and no error records. id=1~3 remain null (due to a lack of stock backfilling).SELECT id, title,vector_dims(content_embedding) AS dims,length(content_embedding::text) AS text_lenFROM kb_articlesWHERE content_embedding IS NOT NULL;
id | title | dims | text_len----+------------+------+----------4 | Embedding Model | 1024 | 127275 | Hunyuan Large Model | 1024 | 12779(2 rows)
-- Updating existing rows triggers the UPDATE trigger even if the content remains unchanged.UPDATE kb_articles SET content = content WHERE id IN (1,2,3);
UPDATE 3
-- Check the pending status immediately (should be 3).SELECT task_kind, pending FROM tencentdb_ai.autoembedding_status;
task_kind | pending-----------+---------incr | 3backfill | 0(2 rows)
pending = 3. All three rows have been enqueued.SELECT pg_sleep(5);-- Perform a full validation.SELECT id, title, content_embedding IS NOT NULL AS has_embeddingFROM kb_articles ORDER BY id;
pg_sleep----------(1 row)id | title | has_embedding----+-----------------+---------------1 | PostgreSQL Introduction | t2 | Tencent Cloud VectorDB | t3 | RAG Technology | t4 | Embedding Model | t5 | Hunyuan Large Model | t(5 rows)
has_embedding = t.SELECT id, title,content_embedding <=> (SELECT content_embedding FROM kb_articles WHERE id = 4) AS distanceFROM kb_articlesWHERE content_embedding IS NOT NULLORDER BY distance;
id | title | distance----+------------+---------------------4 | Embedding Model | 05 | Hunyuan Large Model | 0.28689392595353047(2 rows)
SELECT id, title,content_embedding <=> (SELECT content_embedding FROM kb_articles WHERE id = 1) AS distanceFROM kb_articlesWHERE content_embedding IS NOT NULLORDER BY distance;
id | title | distance----+-----------------+---------------------1 | PostgreSQL Introduction | 02 | Tencent Cloud VectorDB | 0.27894660689305753 | RAG Technology | 0.35634816927513164 | Embedding Model | 0.38403617384205585 | Hunyuan Large Model | 0.40611747180705204(5 rows)
POST https://tokenhub.tencentmaas.com/v1/embeddingsPOST https://tokenhub.tencentmaas.com/v1/embeddings/multimodalAuthorization: Bearer <api_key>Attribute | kinfra-text-embedding-0.6b | kinfra-text-embedding-4b |
Parameter Volume | 0.6B (600 million) | 4B (4 billion) |
Output Dimension | 1024 dimensions | 2560 dimensions |
Context Length | 32k tokens | 32k tokens |
Supported Languages | 30+ languages: Chinese, English, Japanese, Korean, French, German, Russian, Portuguese, Spanish, and so on. | Same as left |
Recommended Scenarios | Large-scale text recall, latency-sensitive, cost-sensitive | High-quality text search and deep semantic understanding |
Typical Tasks | Semantic search, similarity calculation, text clustering, text classification, FAQ matching, intelligent Q&A, knowledge base search | Same as left, with higher precision |
Evaluation Metric | 0.6b | 4b | Improved by |
Mean(Task) Overall Score | 66.64 | 72.63 | +9.0% |
Retrieval | 71.01 | 77.02 | +8.5% |
Clustering | 68.60 | 78.15 | +13.9% |
Semantic Textual Similarity (STS) | 54.88 | 61.41 | +11.9% |
Classification | 71.46 | 75.55 | +5.7% |
Reranking | 64.16 | 68.26 | +6.4% |
Attribute | kinfra-vl-embedding-2b | kinfra-vl-embedding-8b |
Parameter Volume | 2B (2 billion) | 8B (8 billion) |
Output Dimension | 2048 dimensions | 4096 dimensions |
Context Length | 32k tokens | 32k tokens |
Supported Modalities | Text + Image + Video | Text + Image + Video |
Supported Languages | 30+ mainstream languages | Same as left |
Recommended Scenarios | Multimodal online search, video search, response speed prioritized | High-precision multimodal search, precision prioritized |
Typical Tasks | Image-text search, video search, multimodal semantic matching, cross-modal image-text search | Same as left, with higher precision |
Evaluation Task | 2b | 8b | Improved by |
MSCOCO Image-to-Text Retrieval | 0.70 | 0.76 | +8.6% |
VisualNews Image-to-Text Retrieval | 0.60 | 0.67 | +11.7% |
WebQA | 0.87 | 0.90 | +3.4% |
VisDial | 0.69 | 0.87 | +26.1% |
Image-Text Retrieval mean | 0.698 | 0.795 | +13.9% |
MMEB-V2 Comprehensive | 69.82 | 75.26 | +7.8% |
Limit | Description |
Image format. | JPEG,PNG,WEBP,BMP,TIFF |
Image pixel range. | 4,096(~64×64)– 1,843,200(~1280×1440) |
Video format. | MP4,AVI,MOV |
Maximum total video pixels. | 7,864,320 |
Maximum video sampling frames. | 64 frames |
Default video fps. | 1.0 |
Vector normalization. | Default L2 normalization |
Encoding format. | Only float is supported. |
Your Requirements | Recommended Model | Reason |
Chinese knowledge base / FAQ search, cost-sensitive, high concurrency | kinfra-text-embedding-0.6b | 1024 dimensions, lightweight and fast |
Multilingual search, requiring deep semantic understanding, with high precision requirements | kinfra-text-embedding-4b | 2560 dimensions, CMTEB comprehensive score 72.63 |
Cross-modal image-text search (search images by text, search text by images) | kinfra-vl-embedding-2b | 2048 dimensions, fast response speed |
Video search, high-precision multimodal matching | kinfra-vl-embedding-8b | 4096 dimensions, MMEB-V2 comprehensive score 75.26 |
Plain text + potential multimodal extension in the future | First register -0.6b or -4b, then add a multimodal model later. | One table can be bound to one model, and multiple tables can use different models. |
backend_type = 'tokenhub' using the fifth parameter of add_model() (the default value is 'hunyuan').api_key (Bearer Token), not SecretId / SecretKey.real_model_name points to the actual model name on TokenHub (for example, kinfra-text-embedding-0.6b).SELECT column_name, data_type FROM information_schema.columnsWHERE table_schema = 'tencentdb_ai' AND table_name = 'model_list'ORDER BY ordinal_position;
column_name | data_type-----------------+-----------model_name | namejson_path | jsonpathsecretid | byteasecretkey | byteaversion | textregion | textid_random | integerkey_random | integerbackend_type | textreal_model_name | nameapi_key | byteaapi_key_random | integerembedding_dim | integer(13 rows)
api_key column (encrypted and stored as bytea), the backend_type column, and the real_model_name column.-- ===== Text Vector Model Registration Template =====-- Key Parameter: You must explicitly pass 'tokenhub' for the fifth parameter, p_backend_type (the default value is 'hunyuan').-- The sixth parameter, real_model_name, is the actual model name on TokenHub.-- Select one of the following based on your actual requirements.-- Model A: Lightweight Text Vector (1024 dimensions, low cost, fast speed)-- Scenarios: Chinese knowledge base search, FAQ matching, text clustering and classificationSELECT tencentdb_ai.add_model('my-text-embed-0.6b', -- Model alias (customizable)NULL, NULL, NULL, -- version, region, json_path (not required)'tokenhub', -- backend_type: must be explicitly specified as 'tokenhub''kinfra-text-embedding-0.6b' -- real_model_name);SELECT tencentdb_ai.update_model_attr('my-text-embed-0.6b', 'api_key', 'sk-tp-yourAPIKey');UPDATE tencentdb_ai.model_list SET embedding_dim = 1024 WHERE model_name = 'my-text-embed-0.6b';-- Model B: High-Precision Text Vector (2560 dimensions, high precision)-- Scenarios: Multilingual deep semantic search, cross-language matching, high-quality semantic understandingSELECT tencentdb_ai.add_model('my-text-embed-4b', -- Model alias (customizable)NULL, NULL, NULL,'tokenhub','kinfra-text-embedding-4b');SELECT tencentdb_ai.update_model_attr('my-text-embed-4b', 'api_key', 'sk-tp-yourAPIKey');UPDATE tencentdb_ai.model_list SET embedding_dim = 2560 WHERE model_name = 'my-text-embed-4b';
-- ===== Multimodal Vector Model Registration Template =====-- The multimodal model supports three types of input: text, image_url, and video_url.-- Used for scenarios such as cross-modal image-text search and video semantic search.-- Model C: Lightweight Multimodal (2048 dimensions, fast response speed)-- Scenarios: Cross-modal image-text search, online multimodal searchSELECT tencentdb_ai.add_model('my-vl-embed-2b', -- Model alias (customizable)NULL, NULL, NULL,'tokenhub','kinfra-vl-embedding-2b' -- VL = Vision-Language (visual-language));SELECT tencentdb_ai.update_model_attr('my-vl-embed-2b', 'api_key', 'sk-tp-yourAPIKey');UPDATE tencentdb_ai.model_list SET embedding_dim = 2048 WHERE model_name = 'my-vl-embed-2b';-- Model D: High-Precision Multimodal (4096 dimensions, highest precision)-- Scenarios: Video search, high-precision multimodal semantic matchingSELECT tencentdb_ai.add_model('my-vl-embed-8b', -- Model alias (customizable)NULL, NULL, NULL,'tokenhub','kinfra-vl-embedding-8b');SELECT tencentdb_ai.update_model_attr('my-vl-embed-8b', 'api_key', 'sk-tp-yourAPIKey');UPDATE tencentdb_ai.model_list SET embedding_dim = 4096 WHERE model_name = 'my-vl-embed-8b';
-- Verify the registration result.SELECT model_name, backend_type, real_model_name, embedding_dim FROM tencentdb_ai.model_list;
tokenhub-embedding, alias pointing to kinfra-text-embedding-0.6b):model_name | backend_type | real_model_name | embedding_dim---------------------+--------------+----------------------------+---------------auto | tokenhub | | -1hunyuan-embedding | hunyuan | | 1024tokenhub-embedding | tokenhub | kinfra-text-embedding-0.6b | 1024(3 rows)
backend_type = tokenhub (which is distinctly different from the hunyuan in Method 1)real_model_name = kinfra-text-embedding-0.6b (the actual model on TokenHub)embedding_dim = 1024Model Alias (Custom) | real_model_name | embedding_dim | Type |
my-text-embed-0.6b | kinfra-text-embedding-0.6b | 1024 | Lightweight Text |
my-text-embed-4b | kinfra-text-embedding-4b | 2560 | High-precision Text |
my-vl-embed-2b | kinfra-vl-embedding-2b | 2048 | Lightweight Multimodal |
my-vl-embed-8b | kinfra-vl-embedding-8b | 4096 | High-precision Multimodal |
DROP TABLE IF EXISTS kb_articles_tokenhub CASCADE;CREATE TABLE kb_articles_tokenhub (id bigserial PRIMARY KEY,title text,content text);INSERT INTO kb_articles_tokenhub (title, content) VALUES('Introduction to PostgreSQL', 'PostgreSQL is a powerful, open-source, object-relational database system, developed actively for over 30 years.'),('Tencent Cloud VectorDB', 'Tencent Cloud VectorDB is a type of database system specifically designed for storing and searching high-dimensional vectors.'),('AI Technology Trends', 'In 2026, artificial intelligence technology witnessed a new wave of development, with multimodal large models becoming mainstream.');
DROP TABLECREATE TABLEINSERT 0 3
-- Note: The model_name parameter uses the alias 'tokenhub-embedding' from the registration.SELECT tencentdb_ai.add_incr_autoembedding_task('public', 'kb_articles_tokenhub',ARRAY['content'],'tokenhub-embedding' -- The model registered via TokenHub) AS incr_task_id;
incr_task_id--------------4(1 row)
\d kb_articles_tokenhub
Table "public.kb_articles_tokenhub"Column | Type | Collation | Nullable | Default-------------------+--------------+-----------+----------+--------------------------------------------------id | bigint | | not null | nextval('kb_articles_tokenhub_id_seq'::regclass)title | text | | |content | text | | |content_embedding | vector(1024) | | |Indexes:"kb_articles_tokenhub_pkey" PRIMARY KEY, btree (id)Triggers:tencentdb_ai_autoemb_ins_4 AFTER INSERT ON kb_articles_tokenhub FOR EACH ROWEXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger('4', '17167', ...)tencentdb_ai_autoemb_upd_4 BEFORE UPDATE OF content ON kb_articles_tokenhub FOR EACH ROWEXECUTE FUNCTION tencentdb_ai._autoembedding_enqueue_trigger('4', '17167', ...)
content_embedding vector(1024) column + INSERT/UPDATE triggers are automatically created.SELECT task_kind, task_id, table_name, model_name, statusFROM tencentdb_ai.autoembedding_statusORDER BY task_id;
task_kind | task_id | table_name | model_name | status-----------+---------+----------------------+---------------------+---------incr | 1 | kb_articles | hunyuan-embedding | enabledbackfill | 1 | kb_articles | hunyuan-embedding |incr | 4 | kb_articles_tokenhub | tokenhub-embedding | enabled(3 rows)
-- Insert new data, and the trigger is automatically enqueued.INSERT INTO kb_articles_tokenhub (title, content) VALUES('Hunyuan Large Model', 'Tencent Hunyuan is a general-purpose large language model self-developed by Tencent, featuring powerful natural language understanding and generation capabilities.');
INSERT 0 1
-- Check pendingSELECT task_kind, task_id, table_name, model_name, pendingFROM tencentdb_ai.autoembedding_status ORDER BY task_id;
task_kind | task_id | table_name | model_name | pending-----------+---------+----------------------+-------------------+---------incr | 1 | kb_articles | hunyuan-embedding | 0backfill | 1 | kb_articles | hunyuan-embedding | 0incr | 5 | kb_articles_tokenhub | tokenhub-embed | 1(3 rows)
pending = 1, and the message has been enqueued.-- Wait for the worker to process.SELECT pg_sleep(10);-- pending statusSELECT task_kind, task_id, pending, failed_countFROM tencentdb_ai.autoembedding_status ORDER BY task_id;-- Vector resultSELECT id, title,content_embedding IS NOT NULL AS has_embedding,CASE WHEN content_embedding IS NOT NULL THEN vector_dims(content_embedding)::text ELSE 'NULL' END AS dimsFROM kb_articles_tokenhub ORDER BY id;-- Error RecordSELECT * FROM tencentdb_ai.autoembedding_error WHERE task_id = 5 ORDER BY created_at DESC LIMIT 5;
pg_sleep----------(1 row)task_kind | task_id | pending | failed_count-----------+---------+---------+--------------incr | 1 | 0 | 0backfill | 1 | 0 | 0incr | 5 | 0 | 0(3 rows)id | title | has_embedding | dims----+-----------------+---------------+------1 | PostgreSQL Introduction | f | NULL2 | Tencent Cloud VectorDB | f | NULL3 | RAG Technology | f | NULL4 | Hunyuan Large Model | t | 1024(4 rows)error_id | msg_id | task_kind | task_id | row_id | error_code | error_message | detail | created_at----------+--------+-----------+---------+--------+------------+---------------+--------+------------(0 rows)
pending = 0, failed_count = 0, with no errors. The vector dimension for id=4 is 1024.-- Updating existing rows triggers the UPDATE trigger to backfill vectors.UPDATE kb_articles_tokenhub SET content = content WHERE id IN (1,2,3);
UPDATE 3
-- Check the pending status (should be 3).SELECT task_kind, pending FROM tencentdb_ai.autoembedding_status WHERE task_id = 5;
task_kind | pending-----------+---------incr | 3(1 row)
pending = 3. All three rows have been enqueued.SELECT pg_sleep(8);-- Full vectors + dimensionSELECT id, title,content_embedding IS NOT NULL AS has_embedding,CASE WHEN content_embedding IS NOT NULL THEN vector_dims(content_embedding)::text ELSE 'NULL' END AS dimsFROM kb_articles_tokenhub ORDER BY id;
pg_sleep----------(1 row)id | title | has_embedding | dims----+-----------------+---------------+------1 | PostgreSQL Introduction | t | 10242 | Tencent Cloud VectorDB | t | 10243 | RAG Technology | t | 10244 | Hunyuan Large Model | t | 1024(4 rows)
SELECT id, title,content_embedding <=> (SELECT content_embedding FROM kb_articles_tokenhub WHERE id = 1) AS distanceFROM kb_articles_tokenhubWHERE content_embedding IS NOT NULLORDER BY distance;
id | title | distance----+-----------------+--------------------1 | PostgreSQL Introduction | 02 | Tencent Cloud VectorDB | 0.53279602136659033 | RAG Technology | 0.68195173007681054 | Hunyuan Large Model | 0.710405861090913(4 rows)
Your Requirements | Model Selection | embedding_dim |
Chinese knowledge base search, FAQ matching, cost-sensitive | kinfra-text-embedding-0.6b | 1024 |
Multilingual deep semantic search, with high precision requirements | kinfra-text-embedding-4b | 2560 |
Cross-modal image-text search, with response speed prioritized | kinfra-vl-embedding-2b | 2048 |
Video search, high-precision multimodal matching | kinfra-vl-embedding-8b | 4096 |
SELECT pid, backend_type, state, query, query_start, state_changeFROM pg_stat_activityWHERE backend_type LIKE '%tencentdb_ai%';
pid | backend_type | state | query | query_start | state_change------+-----------------------------------+--------+-------------------------------------------------------------+-------------------------------+------------------------------67832 | tencentdb_ai scheduler | | | |67834 | tencentdb_ai autoembedding worker | active | SELECT tencentdb_ai._autoembedding_process_backfill_batch() | 2026-08-05 22:40:37.409162+08 | 2026-08-05 22:40:37.41009+08(2 rows)
tencentdb_ai scheduler and tencentdb_ai autoembedding worker, are running.SELECT * FROM tencentdb_ai.autoembedding_errorORDER BY created_at DESC LIMIT 10;
error_id | msg_id | task_kind | task_id | row_id | error_code | error_message | detail | created_at----------+--------+-----------+---------+--------+------------+---------------+--------+------------(0 rows)
Last updated:2024-01-24 11:16:51
Feature | Classic Network | VPC |
Custom network | Unsupported | Supported |
Custom routing | Unsupported | Supported |
Custom IP | Unsupported | Supported |
Interconnection rule | Interconnection in the same region | Interconnection between subnets in the same VPC in the same region |
Security control | Security group | Security group |
Last updated:2026-03-31 11:51:45




Last updated:2025-04-23 21:44:46


Last updated:2026-03-11 15:07:27






Parameter | Description |
Host name/address | Enter the address of the CLB instance. You can view the VIP information in the basic info on the CLB instance details page. |
Port | Enter the port of the CLB instance. You can view the TCP port number under Monitor Management on the CLB instance details page. |
Username | Enter the account name of the PostgreSQL instance to be connected. The account is created under Instance Management > Database Management > Account Management. |
Password | Enter the password corresponding to the filled-in Username, then click Save. |


Last updated:2026-05-15 13:00:32
Task | Link |
Understanding the Basic Policy Structure | |
Defining Operations in a Policy | |
Defining Resources in a Policy | |
Resource-Level Permissions Supported by PostgreSQL | |
Console Figure Example |
Last updated:2024-01-24 11:16:51
{"version":"2.0","statement":[{"effect":"effect","action":["action"],"resource":["resource"],"condition": {"key":{"value"}}}]}
effect, action, resource, and condition. One policy has only one statement."action":["postgres:action1","postgres:action2"]
"action":["postgres:Describe*"]
"action":["postgres:*"]
qcs:project_id:service_type:region:account:resource
Resource | Resource Description Method in Access Policies |
Instance | qcs::postgres:$region:$account:DBInstanceId/$DBInstanceId |
"resource":[ "qcs::postgres:ap-shanghai:164xxx472:DBInstanceId/postgres-0xssvm8e"]
"resource":[ "qcs::postgres:ap-shanghai:164xxx472:DBInstanceId/*"]
resource element as shown below:"resource": ["*"]
"resource":["qcs::postgres::164xxx472:DBInstanceId/postgres-0xf1f41e","qcs::postgres::164xxx472:DBInstanceId/postgres-0xssvm8e"]
Last updated:2026-05-15 14:44:39
Resource Type | Resource Description Method in Authorization Policies |
qcs::postgres:$region:$account:DBInstanceId/$DBInstanceId qcs::postgres:$region:$account:DBInstanceId/* |
$region and $account with your actual parameter information. You can also use the * wildcard in the path. For related operation examples, refer to Console Examples.API Operations | API Overview |
CreateDBInstances | Creating an Instance |
CreateServerlessDBInstance | Create a ServerlessDB Instance |
DescribeOrders | Obtain Order Information. |
DescribeRegions | Query the available regions for sale. |
DescribeZones | Query the available zones for sale |
DescribeProductConfig | Query the available specification configurations for sale. |
InquiryPriceCreateDBInstances | Query the price for sale. |
DescribeServerlessDBInstances | Query the ServerlessDB instance list. |
API Name | API Feature |
CloseServerlessDBExtranetAccess | Disable the public network for the serverlessDB instance. |
DeleteServerlessDBInstance | Delete a ServerlessDB Instance. |
OpenServerlessDBExtranetAccess | Enable the public network for the ServerlessDB instance. |
API Name | API Feature |
DescribeDBBackups | Querying the Backup Task List of an Instance |
DescribeDBErrlogs | Retrieve error logs. |
DescribeDBSlowlogs | Retrieve slow query logs. |
DescribeDBXlogs | Retrieve the Xlog list of an instance. |
API Name | API Feature |
CloseDBExtranetAccess | Disable the public network connection for the instance. |
DescribeDBInstanceAttribute | Querying instance details |
DescribeDatabases | Retrieve the database list. |
DestroyDBInstance | Terminating an instance. |
InitDBInstances | Instance of Initializing |
InquiryPriceRenewDBInstance | Querying instance upgrade prices |
InquiryPriceUpgradeDBInstance | Querying instance upgrade prices. |
ModifyDBInstanceName | Modify the instance name. |
ModifyDBInstancesProject | Move the instance to another project. |
OpenDBExtranetAccess | Enable the public network. |
RenewInstance | Renewing an Instance |
RestartDBInstance | Restarting an Instance |
SetAutoRenewFlag | Enabling Auto-Renewal |
UpgradeDBInstance | Upgrade the instance. |
DescribeDBInstances | Queries the instance list |
API Name | API Feature |
DescribeAccounts | Obtain the instance user list. |
ModifyAccountRemark | Modifying Account Remarks |
ResetAccountPassword | Reset Account Password |
Last updated:2025-09-10 22:18:28
"action": ["postgres:DescribeProductConfig","postgres:InquiryPriceCreateDBInstances","postgres:DescribeRegions","postgres:DescribeZones"]
{"effect": "allow","action": ["monitor:Get*","monitor:Describe*"],"resource": "*"}
QcloudPostgreSQLFullAccess policy with the user.
This policy grants the user permissions to operate all PostgreSQL resources. You can find more details below:
Associate the default policy QcloudPostgreSQLFullAccess with the user as instructed in Authorization Management.QcloudPostgreSQLReadOnlyAccess policy with the user. Users assigned will not have the access to create, delete, or modify PostgreSQL instances.
This policy grants the user permissions of all PostgreSQL operations that begin with the word "Describe" or "Inquiry". The detailed steps are as follows:
Associate the default policy PostgreSQL with the user as instructed in Authorization Management.{"version": "2.0","statement": [{"action": "postgres:*","resource": "qcs::postgres:ap-shanghai:103xxx1481:DBInstanceId/postgres-0xxxx8e","effect": "allow"}]}
{"version": "2.0","statement": [{"action": "postgres:*","resource": "qcs::postgres:::*","effect": "allow"}]}
{"version": "2.0","statement": [{"action": "postgres:*","resource": ["qcs::postgres::16xxx472:DBInstanceId/postgres-c8xxxa4","qcs::postgres::16xxx472:DBInstanceId/postgres-d8xxxb4",],"effect": "deny"}]}
Last updated:2024-12-04 12:53:23
c can be encrypted from any plaintext m, and its relevance to the plaintext cannot be found in itself.

Last updated:2026-05-25 14:39:05

Last updated:2026-03-31 14:31:50


.postgresql folder under the /usr/local/pgsql/ directory.mkdir -p /usr/local/pgsql/.postgresql
ca.pem and ca.jks to the .postgresql folder.[root@VM-0-6-tencentos .postgresql]# lltotal 4-rw------- 1 postgres postgres 2681 Feb 6 11:13 ca.pem
.postgresql folder.chown postgres:postgres /usr/local/pgsql/.postgresql/*chmod 600 /usr/local/pgsql/.postgresql/*
postgres user.[root@VM-0-6-tencentos .postgresql]# export PGSSLROOTCERT="/usr/local/pgsql/.postgresql/ca.pem"[root@VM-0-6-tencentos .postgresql]# echo $PGSSLROOTCERT/usr/local/pgsql/.postgresql/ca.pem
[root@VM-0-6-tencentos .postgresql]# export PGSSLMODE="require"[root@VM-0-6-tencentos .postgresql]# echo $PGSSLMODErequire
[root@VM-0-6-tencentos .postgresql]# psql -h10.6.0.1 -p5432 -Udbadmin -dpostgresPassword for user dbadmin:psql (16.4, server 11.22)SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)Type "help" for help.postgres=>
SSL connection, it indicates that the current connection uses SSL encryption..postgresql folder under the /usr/local/pgsql/ directory.mkdir -p /usr/local/pgsql/.postgresql
ca.jks to the .postgresql folder.[root@VM-0-6-tencentos .postgresql]# lltotal 8-rw------- 1 postgres postgres 2840 Feb 6 19:55 ca.jks-rw------- 1 postgres postgres 2681 Feb 6 11:13 ca.pem
.postgresql folder.chown postgres:postgres /usr/local/pgsql/.postgresql/*chmod 600 /usr/local/pgsql/.postgresql/*
.pem certificate is as follows. Specific parameters are configured based on your business details.import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;import java.util.Properties;public class Main {public static void main(String[] args) {try {Class.forName("org.postgresql.Driver");Properties props = new Properties();props.setProperty("user", "xxxxxxx");props.setProperty("password", "xxxxxxxx");props.setProperty("ssl", "true");props.setProperty("sslmode", "require");props.setProperty("sslrootcert", "/usr/local/pgsql/.postgresql/ca.pem");Connection conn = DriverManager.getConnection("jdbc:postgresql://10.6.0.1:5432/postgres",props);Statement stmt = conn.createStatement();ResultSet rs = stmt.executeQuery("SELECT * FROM mytable");while (rs.next()) {System.out.println(rs.getString("id"));}conn.close();} catch (Exception e) {e.printStackTrace();}}}
jks certificate is as follows. Specific parameters are configured based on your business details.import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;import java.util.Properties;public class Main1 {public static void main(String[] args) {try {Class.forName("org.postgresql.Driver");System.setProperty("javax.net.ssl.trustStore", "/usr/local/pgsql/.postgresql/ca.jks");System.setProperty("javax.net.ssl.trustStorePassword","tencentdb_pg");System.setProperty("javax.net.ssl.keyStore","/usr/local/pgsql/.postgresql/ca.jks");System.setProperty("javax.net.ssl.keyStorePassword","tencentdb_pg");Properties props = new Properties();props.setProperty("user", "xxxxx");props.setProperty("password", "xxxxx");props.setProperty("ssl", "true");props.setProperty("sslmode", "require");props.setProperty("sslfactory", "org.postgresql.ssl.DefaultJavaSSLFactory");Connection conn = DriverManager.getConnection("jdbc:postgresql://10.6.0.1:5432/postgres",props);Statement stmt = conn.createStatement();ResultSet rs = stmt.executeQuery("SELECT * FROM mytable");while (rs.next()) {System.out.println(rs.getString("id"));}conn.close();} catch (Exception e) {e.printStackTrace();}
.postgresql folder under the /usr/local/pgsql/ directory.mkdir -p /usr/local/pgsql/.postgresql
ca.pem to the .postgresql folder.[root@VM-0-6-tencentos .postgresql]# lltotal 4-rw------- 1 postgres postgres 2681 Feb 6 11:13 ca.pem
.postgresql folder.chown postgres:postgres /usr/local/pgsql/.postgresql/*chmod 600 /usr/local/pgsql/.postgresql/*
package mainimport ("database/sql""fmt""log"_ "github.com/lib/pq")func main() {connStr := "user=dbadmin password=xxxxx dbname=postgres host=10.6.0.1 port=5432 sslmode=require sslrootcert=/usr/local/pgsql/.postgresql/ca.pem"db, err := sql.Open("postgres", connStr)if err != nil {log.Fatal(err)}err = db.Ping()if err != nil {log.Fatal(err)}fmt.Println("Successfully connected!")}
.postgresql folder under the /usr/local/pgsql/ directory.mkdir -p /usr/local/pgsql/.postgresql
ca.pem to the .postgresql folder.[root@VM-0-6-tencentos .postgresql]# lltotal 4-rw------- 1 postgres postgres 2681 Feb 6 11:13 ca.pem
.postgresql folder.chown postgres:postgres /usr/local/pgsql/.postgresql/*chmod 600 /usr/local/pgsql/.postgresql/*
const { Client } = require('pg');const fs = require('fs');const tls = require('tls');// Configure database connection parametersconst client = new Client({user: '****',host: '**.**.**.**',database: '*****',password: '*****',port: 5432, // Default portssl: {host: '**.**.**.**',ca: fs.readFileSync('./ca.pem').toString(), // CA certificate path},});// Connect to the databaseclient.connect().then(() => {console.log('Connected to PostgreSQL');// Query the pg_stat_ssl view to obtain detailed SSL information of the current connection. The query here can be customized by the business.const query = `SELECT ssl, version, cipher, bitsFROM pg_stat_sslWHERE pid = pg_backend_pid();`;return client.query(query);}).then(res => {if (res.rows.length > 0) {const sslInfo = res.rows[0];console.log('SSL connection:', sslInfo.ssl);console.log('SSL version:', sslInfo.version);console.log('SSL cipher:', sslInfo.cipher);console.log('SSL bits:', sslInfo.bits);} else {console.log('No SSL information available for this connection.');}return client.end();}).catch(err => console.error('Connection error', err.stack));



Last updated:2026-09-08 10:21:59
postgres=> \dx;List of installed extensionsName | Version | Schema | Description-----------------------+---------+------------+------------------------------------------------------------------------pg_stat_log | 1.0 | public | track runtime execution statistics of all SQL statements executedpg_stat_statements | 1.9 | public | track planning and execution statistics of all SQL statements executedplpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagetencentdb_serverless | 1.0 | public | extension for serverless modetencentdb_system_stat | 1.0 | public | track execution statistics of querssy executed(5 rows)
postgres=> show tencentdb_serverless.min_cpu_cores;tencentdb_serverless.min_cpu_cores------------------------------------8(1 row)postgres=> show tencentdb_serverless.max_cpu_cores;tencentdb_serverless.max_cpu_cores------------------------------------8(1 row)
tencentdb_serverless.set_database_cpu_limit(database_name text [, min_cpu_cores numeric(5,1), max_cpu_cores numeric(5,1)])
postgres=> select tencentdb_serverless.set_database_cpu_limit('tenant_001',2,2.5);set_database_cpu_limit------------------------(1 row)
tencentdb_serverless.reset_database_limit(database_name text)
postgres=> select tencentdb_serverless.reset_database_limit('tenant_001');reset_database_limit----------------------(1 row)
tencentdb_serverless.reset_all_database_limit()
postgres=> select tencentdb_serverless.reset_all_database_limit();reset_all_database_limit--------------------------(1 row)
Column Name | Description |
database_name | Database name |
min_cpu_cores | Minimum CPU cores available to the current database |
max_cpu_cores | Maximum CPU cores available to the current database |
min_mem_kilobytes | Maximum memory size available to the current database, in kB. Reserved field, not in use yet. |
max_mem_kilobytes | Maximum memory size available to the current database, in kB. Reserved field, not in use yet. |
postgres=> select * from tencentdb_serverless.resource_limit_view;database_name | min_cpu_cores | max_cpu_cores | min_mem_kilobytes | max_mem_kilobytes---------------+---------------+---------------+-------------------+-------------------tenant_001 | 2.0 | 2.5 | |tenant_002 | 2.0 | 2.5 | |(2 rows)
postgres=> select datname,sum(cpu_usage) as cpu_usage from tencentdb_process_system_usage where datname !='NULL' group by datname;datname | cpu_usage------------+-----------postgres | 3tenant_001 | 1.99tenant_002 | 1(3 rows)

Last updated:2026-09-08 10:21:59
postgres=> \dx;List of installed extensionsName | Version | Schema | Description-----------------------+---------+------------+------------------------------------------------------------------------pg_stat_log | 1.0 | public | track runtime execution statistics of all SQL statements executedpg_stat_statements | 1.9 | public | track planning and execution statistics of all SQL statements executedplpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagetencentdb_serverless | 1.0 | public | extension for serverless modetencentdb_system_stat | 1.0 | public | track execution statistics of querssy executed(5 rows)
postgres=> show tencentdb_serverless.min_cpu_cores;tencentdb_serverless.min_cpu_cores------------------------------------4(1 row)postgres=> show tencentdb_serverless.max_cpu_cores;tencentdb_serverless.max_cpu_cores------------------------------------4(1 row)
tencentdb_serverless.set_database_cpu_limit(database_name, min_cpu_cores, max_cpu_cores)
Parameter | Description |
database_name | Name of the specific database for which resource isolation needs to be configured. |
min_cpu_cores | This parameter specifies the minimum number of CPU cores available to the database. When the overall instance resources are insufficient, this quota ensures that the database can still receive its allocated share. The quota is allocated on A percentage basis. For example, if the current instance has three databases named A, B, and C, with minimum quotas of 2, 3, and 3 respectively, and the instance currently has 8 CPU cores, then the minimum number of cores available to A is calculated as (2 / (2 + 3 + 3)) * 8 = 2 cores. |
max_cpu_cores | This parameter specifies the maximum number of CPU cores available to the database. The value cannot exceed the current number of cores of the instance. If you do not need to set a maximum CPU resource limit for the database, set this parameter to -1. |
postgres=> select tencentdb_serverless.set_database_cpu_limit('tenant_001',0.1,1);set_database_cpu_limit------------------------(1 row)
postgres=> select * from tencentdb_serverless.resource_limit_view;database_name | min_cpu_cores | max_cpu_cores | min_mem_kilobytes | max_mem_kilobytes---------------+---------------+---------------+-------------------+-------------------tenant_001 | 0.1 | 1.0 | |(1 row)
postgres=> select tencentdb_serverless.reset_database_limit('tenant_001');reset_database_limit----------------------(1 row)
postgres=> select datname from pg_database where datname not like 'template%';datname------------postgresipbibp_hktenant_001(4 rows)
select tencentdb_serverless.set_database_cpu_limit('ipb',0.25,1); -- Limit the CPU usage to 25% at most.select tencentdb_serverless.set_database_cpu_limit('ibp_hk',0.25,1); -- Limit the CPU usage to 25% at most.
select tencentdb_serverless.set_database_cpu_limit('postgres',1,-1); -- Do not limit the database CPU usage.select tencentdb_serverless.set_database_cpu_limit('tenant_001',1,-1); -- Do not limit the database CPU usage.
Last updated:2026-05-06 15:52:48
Template | Description | Scenario |
Open All Ports | All ports are opened to the public network and private network by default, which has certain security risks. | - |
Ports 22, 80, 443, 3389 and the ICMP protocol are opened. | By default, ports 22, 80, 443, 3389 and the ICMP protocol are opened. The private network is fully opened. | This template does not take effect for cloud databases. |
Custom | After the security group is successfully created, add security group rules as needed. For specific operations, see "Adding Security Group Rules" below. | We recommend that you select this template to customize a template for accessing specified instances. |
Specified Source/Destination | Description |
Single IPv4 address or IPv4 address range | Use CIDR notation (such as 203.0.113.0, 203.0.113.0/24, or 0.0.0.0/0, where 0.0.0.0/0 indicates that all IPv4 addresses will be matched). |
Single IPv6 address or IPv6 address range | Use CIDR notation (such as FF05::B5, FF05:B5::/60, ::/0, or 0::0/0, where ::/0 or 0::0/0 indicates that all IPv6 addresses will be matched). |
Reference of a security group ID. You can refer to the IDs of the following security groups: Security group Other security groups | The current security group indicates the CVM associated with the security group. Other security groups indicate another security group ID under the same item in the same area. |
Reference of an IP address object or IP address group object in the Parameter Template | - |
Direction | Type | Source | Protocol Port | Policy |
Inbound | Custom | All IP addresses: 0.0.0.0/0 Specifying IP: Enter the IP or IP range you specify | TCP:5432 | Allow |
Last updated:2024-12-04 12:51:31

Last updated:2025-09-10 22:19:27
Metric Name | Monitoring Metric Name | Unit | Metric Type |
CPU utilization | cpu | % | Actual CPU utilization |
used storage space | storage | GB | Instance space size |
Memory Usage | memory | MBytes | Actual memory usage. |
Memory usage | memory_rate | % | Actual memory utilization |
QPS | qps | Times/second | Number of executed SQL statements per second. |
Number of Connections | connections | Counts | Number of database connections during collection. |
Number of requests | read_write_calls | Times | Number of read/write requests in a statistical period. |
Number of read requests | read_calls | Times | Number of read requests in a statistical period. |
Number of write requests | write_calls | Times | Number of write requests in a statistical period. |
Other Requests | other_calls | Times | Number of other requests in a statistical period (requests other than SELECT, INSERT, UPDATE, DELETE). |
Buffer cache hit rate | hit_percent | % | Hit rate of all SQL statements executed in a statistical period |
Average execution latency | sql_runtime_avg | ms | Average execution latency of all SQL statements in one statistical period. |
Longest TOP10 Execution Latency | sql_runtime_max | ms | Longest TOP10 average execution latency of SQL statements in a statistical period. |
Shortest TOP10 Execution Latency | sql_runtime_min | ms | Shortest TOP10 average execution latency of SQL statements in a statistical period. |
The number of remaining XIDs | remain_xid | Counts | During database collection, display the remaining xid count of the database with the least xid. No such metric for read-only instances. |
Standby log shipping and playback position difference | xlog_diff | Byte | The size difference between logs sent from the primary database to the standby and replay completed reflects the speed of log application on the standby. This metric can help evaluate standby performance and network transmission speed. No such metric for read-only instances. |
Storage Usage | storage_rate | % | Total storage utilization, including temporary files, data files, log files, and other database files. |
Number of Slow Queries | slow_query_cnt | Counts | The number of slow queries in a collection cycle. |
log write delay | xlog_diff | Byte | The size difference between logs sent from the primary database to the standby and replay completed reflects the speed of log application on the standby. This metric can help evaluate standby performance and network transmission speed. No such metric for read-only instances. |
log write time delay | xlog_diff_time | Seconds | The time difference between logs sent from the primary database to the standby and logs received and written to disk. No such metric for read-only instances, and this metric is only available for instance versions 10.x or later. |
Primary-standby data synchronization delay | slave_apply_delay | Byte | The size difference between standby database replay LSN and current LSN of primary instance. For the primary instance, this metric reflects the RTO for fault switch. For read-only instances, it reflects data latency. |
Primary-standby data sync delay time | replay_lag | Seconds | The delay time of data sync between the primary and replica databases. A shorter delay means the primary-replica data is more consistent. During primary database failure, less data is lost after the switch. |
Number of Active Connections | active_conns | Counts | Trigger database collection during instantaneous active connections (non-idle connection). |
Number of idle connections | idle_conns | Counts | Query instantaneous idle connections in the database during collection. |
Number of SQL statements with execution duration exceeding 1 second | long_query | Counts | Number of SQL statements being executed with execution time exceeding 1 second during database collection. |
Number of transactions with execution duration exceeding 1 second | long_xact | Counts | Number of transactions with execution time exceeding 1 second during database collection. |
Number of idle transactions | idle_in_xact | Counts | Number of transactions in idle in transaction state when triggering database collection. |
Number of idle transactions exceeding 5 seconds | long_idle_in_xact | Counts | Number of transactions in idle in transaction state exceeding 5 seconds during database collection. |
Number of waiting sessions | waiting | Counts | Number of database connections in a waiting state. |
Number of sessions waiting exceeding 5 seconds | long_waiting | Counts | The number of database connections with a waiting time exceeding 5 seconds. |
Number of 2PC transactions | 2PC | Counts | Number of 2PC transactions during database collection. |
Number of 2PC transactions unsubmitted for over 5 seconds | long_2pc | Counts | Number of 2PC transactions with execution time exceeding 5 seconds during database collection. |
Number of new connections within 5 seconds | new_conn_in5s | Counts | Query all connection counts established within the last 5 seconds when triggering database collection. |
TPS | tps | Times/second | Number of successful transactions per second (including rollbacks and submissions). |
Number of transaction commits | xact_commit | Times/second | Average transactions per second in a statistical period. |
Transaction rollback count | xact_rollback | Times/second | The average number of rolled-back transactions per second in a statistical period. |
Number of record deletions per second | tup_deleted | Counts | Average number of tuples deletions per second in a statistical period. No Such Metric for read-only instances. |
Number of insertions per second | tup_inserted | Counts | Average number of tuples insertions per second in a statistical period. No Such Metric for read-only instances. |
Number of record updates per second | tup_updated | Counts | Average number of tuples updates per second in a statistical period. No Such Metric for read-only instances. |
Number of index scan records per second | tup_fetched | Counts | Average number of index scan tuples per second in a statistical period. |
Number of full-table scan records per second | tup_returned | Counts | The number of full-table scan tuples per second in a statistical period. |
Number of deadlocks | deadlocks | Counts | Number of deadlocks in a statistical period. |
log file size | log_file_size | GB | WAL log file occupied space size. |
Size of data files | data_file_size | GB | Data file occupied space size. |
Temporary file size | temp_file_size | MB | Temporary file size. |
throughput rate | throughput | KBytes/s | Disk read/write speed per instance per second. |
Read Throughput | throughput_read | KBytes/s | Instance disk read speed per second. |
Write Throughput | throughput_write | KBytes/s | Disk write speed per instance per second. |
connection utilization | conn_utilization | % | Current number of instance connections/Maximum number of connections. |
instance port inbound traffic | cluster_in_flow | KBytes/s | Inbound traffic on the database instance listening port. |
instance port outbound traffic | cluster_out_flow | KBytes/s | Outbound traffic on the database instance listening port. |
Last updated:2026-03-31 10:43:39

Last updated:2026-03-31 10:46:45
Tag Key | Tag Value |
Business | Game 1, game 2, and game 3 |
OPS Owner | John, Jane, and Harry |
instance-id | Business | Ops Owner |
postgres-abcdef1 | Game 1 | Harry |
postgres-abcdef2 | Game 2 | Jane |
postgres-abcdef3 | Game 3 | John |
Last updated:2025-09-10 22:15:38


