Querying the Definition Information of a Specified Table
Function
This API is used to query the definition information of a specified table. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
GET /v3/{project_id}/instances/{instance_id}/list-table-definition
|
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 The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
|
instance_id |
Yes |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value can contain 36 characters. Only letters and digits are allowed. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
database_name |
Yes |
String |
Definition Database name. Constraints N/A Range N/A Default Value N/A |
|
schema_name |
No |
String |
Definition Schema name. Constraints N/A Range N/A Default Value N/A |
|
table_name |
Yes |
String |
Definition Table name. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the token value. Constraints N/A Range N/A Default Value N/A |
|
X-Language |
No |
String |
Definition Language. Constraints N/A Range
Default Value en-us |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
table_definitions |
Array of SchemaTableDefinition |
Definition Database table definition information. For details, see Table 5. |
Example Request
Querying the definition information of a specified table
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/3d39c18788b54a919bab633874c159dfin14/instances/3d39c18788b54a919bab633874c159dfin01/list-table-definition?database_name=postgres&table_name=t1&schema_name=public
Example Response
{
"table_definitions": [
{
"schema_name": "public",
"table_definition": "SET search_path = public;\nCREATE TABLE sbtest178 (\n id integer NOT NULL,\n k integer DEFAULT 0 NOT NULL,\n c character(120) DEFAULT ''::bpchar NOT NULL,\n pad character(60) DEFAULT ''::bpchar NOT NULL\n)\nWITH (orientation=row, compression=no, storage_type=USTORE, segment=off)\nDISTRIBUTE BY HASH(id)\nTO GROUP group_version_20250429_155518_878976;\nCREATE INDEX k_178 ON sbtest178 USING ubtree (k) WITH (storage_type=USTORE) TABLESPACE pg_default;\nALTER TABLE sbtest178 ADD CONSTRAINT sbtest178_pkey PRIMARY KEY USING ubtree (id) WITH (storage_type=USTORE);"
}
]
}
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot