All Products
Search
Document Center

AnalyticDB:Initialize the vector database

Last Updated:Jan 15, 2026

Before using the AnalyticDB for PostgreSQL vector database, follow the instructions in this topic to set up the vector database and full-text search capabilities.

Each instance requires a one-time initialization. The initialization process performs the following actions:

  • Creates the knowledgebase database to store all vector data and grants read and write permissions to it.

  • Enables Chinese tokenizers and full-text search capabilities, both of which are database-level features.

Initialize a vector database

from alibabacloud_gpdb20160503 import models as gpdb_20160503_models


def init_vector_database(account, account_password):
    request = gpdb_20160503_models.InitVectorDatabaseRequest(
        region_id=ADBPG_INSTANCE_REGION,
        dbinstance_id=ADBPG_INSTANCE_ID,
        manager_account=account,
        manager_account_password=account_password
    )
    response = get_client().init_vector_database(request)
    print(f"init_vector_database response code: {response.status_code}, body:{response.body}")


if __name__ == '__main__':
    init_vector_database("testacc", "Test1234")


# output: body:
# {
#    "Message":"success",
#    "RequestId":"FC1E0318-E785-1F21-A33C-FE4B0301B608",
#    "Status":"success"
# }

The init_vector_database parameters are as follows:

  • account: The privileged account for the AnalyticDB for PostgreSQL instance.

  • account_password: The password for the privileged account.

Verify the results

Once the API call is successful, log on to the DMS console to confirm that the knowledgebase database has been created in the target instance.