tencent cloud

APIs

DescribeDatabaseObjects

Focus Mode
Font Size
Last updated: 2026-04-13 13:07:24

1. API Description

Domain name for API request: postgres.intl.tencentcloudapi.com.

This API is used to query database object list, such as the mode list in test database.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeDatabaseObjects.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
DBInstanceId Yes String Instance ID. obtain through the api DescribeDBInstances.
ObjectType Yes String Specifies the object type for querying. supported objects: database, schema, sequence, procedure, type, function, table, view, matview, column.
Limit No Integer Number of items displayed at a time. default 20. value range 0-100.
Offset No Integer Data offset, starting from 0.
DatabaseName No String Describes the database the query object belongs to. this parameter is required when the query object type is not database.
SchemaName No String Specifies the mode belonging to the query object. this parameter is required when the query object type is not database or schema.
TableName No String Specifies the table belonging to the query object. this parameter is required when the query object type is column.

3. Output Parameters

Parameter Name Type Description
ObjectSet Array of String Query object list.
Note: This field may return null, indicating that no valid values can be obtained.
TotalCount Integer Specifies the total number of objects.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Query Object As database

This example shows you how to query the database list.

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDatabaseObjects
<Common request parameters>

{
    "DBInstanceId": "postgres-5cz25tr5",
    "ObjectType": "database"
}

Output Example

{
    "Response": {
        "ObjectSet": [
            "postgres",
            "postgres_bak_1715170243",
            "user_database"
        ],
        "TotalCount": 3,
        "RequestId": "c90f7a9d-f519-4d2f-bb2f-e3966cd102b6"
    }
}

Example2 Querying schema As the Query Object

This example shows you how to query the mode in user_database.

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDatabaseObjects
<Common request parameters>

{
    "DBInstanceId": "postgres-5cz25tr5",
    "ObjectType": "schema",
    "Limit": 2,
    "Offset": 1,
    "DatabaseName": "user_database"
}

Output Example

{
    "Response": {
        "ObjectSet": [
            "information_schema",
            "pg_catalog"
        ],
        "TotalCount": 2,
        "RequestId": "bb6146b9-0c63-40ea-b89a-d83944805b79"
    }
}

Example3 Querying a table Object

This example shows you how to query tables in the user_database database that belong to the user_schema mode.

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDatabaseObjects
<Common request parameters>

{
    "DBInstanceId": "postgres-5cz25tr5",
    "ObjectType": "table",
    "DatabaseName": "user_database",
    "SchemaName": "user_schema"
}

Output Example

{
    "Response": {
        "ObjectSet": [
            "users",
            "users1",
            "users2"
        ],
        "TotalCount": 3,
        "RequestId": "80530420-d73e-4a60-8149-93cf800220b9"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.FailedOperationError Operation failed. Please try again later.
FailedOperation.PreCheckError Pre-check failed
OperationDenied.InstanceAccessDeniedError You do not have the permission to operate this resource.
OperationDenied.InstanceStatusLimitOpError This operation cannot be performed on an instance in this status.
ResourceNotFound.InstanceNotFoundError The instance does not exist.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback