Updated on 2025-08-20 GMT+08:00

Querying Extensions

Function

This API is used to obtain extension information of a specified database.

Constraints

This operation cannot be performed when the DB instance is in any of the following statuses: creating, changing instance class, changing port, frozen, or abnormal.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/extensions?database_name={database_name}&offset={offset}&limit={limit}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    database_name

    Yes

    Definition

    Database name.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    offset

    No

    Definition

    Index offset. The query starts from the next piece of data indexed by this parameter.

    Constraints

    N/A

    Range

    The value must be a non-negative number.

    Default Value

    The default value is 0, indicating that the query starts from the first data record.

    limit

    No

    Definition

    Number of records to be queried.

    Constraints

    N/A

    Range

    1–100

    Default Value

    100

Request

  • Request parameters

    None

  • URI example

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/f569f1358436479dbcba8603c32cc4aein03/extensions?database_name=db1

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    extensions

    Array of objects

    Definition

    Extension list.

    For details, see Table 3.

    total_count

    Integer

    Definition

    Total number of extensions.

    Range

    N/A

    Table 3 extensions element structure description

    Parameter

    Type

    Description

    name

    String

    Definition

    Extension name.

    Range

    N/A

    database_name

    String

    Definition

    Database name.

    Range

    N/A

    version

    String

    Definition

    Extension version.

    Range

    N/A

    version_update

    String

    Definition

    New version that the extension can be upgraded to. If the value of this parameter is different from that of version, the extension can be upgraded.

    Range

    N/A

    shared_preload_libraries

    String

    Definition

    Dependent preloaded library.

    Range

    N/A

    created

    Boolean

    Definition

    Whether the extension has been created.

    Range

    N/A

    description

    String

    Definition

    Extension description.

    Range

    N/A

  • Example normal response
    { 
       "extensions" : [ { 
         "name" : "pg_cron", 
         "database_name" : "db1", 
         "version" : "1.0", 
         "version_update" : "1.0", 
         "shared_preload_libraries" : "pg_cron", 
         "created" : false, 
         "description" : "pg_cron access method - signature file based index" 
       }, { 
         "name" : "dblink", 
         "database_name" : "db1", 
         "version" : "1.2", 
         "version_update" : "1.2", 
         "shared_preload_libraries" : "", 
         "created" : false, 
         "description" : "connect to other PostgreSQL databases from within a database" 
       } ], 
       "total_count" : 2 
     }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.