URL: http://GPUDB_IP_ADDRESS:GPUDB_PORT/alter/table
Apply various modifications to a table or collection. Available modifications include:
Creating or deleting an index on a particular column. This can speed up certain search queries (such as /get/records, /delete/records, /update/records) when using expressions containing equality or relational operators on indexed columns. This only applies to child tables.
Making a table protected or not. Protected tables need the admin password to be sent in a /clear/table to delete the table. This can be applied to child tables or collections or views.
Setting the time-to-live (TTL). This can be applied to tables, views, or collections. When applied to collections, every table & view within the collection will have its TTL set to the given value.
Allowing homogeneous child tables. This only applies to collections.
Input Parameter Description
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
table_name | string | Table on which the operation will be performed. Must be a valid table or collection in GPUdb. | ||||||||||||
action | string | Modification operation to be applied to the table or collection
|
||||||||||||
value | string | The value of the modification. May be a column name, 'true' or 'false', or a time-to-live depending on input parameter action. | ||||||||||||
options | map of strings | Optional parameters. Default value is an empty map ( {} ). |
Output Parameter Description
The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | String | 'OK' or 'ERROR' | ||||||||||||
message | String | Empty if success or an error message | ||||||||||||
data_type | String | 'alter_table_request' or 'none' in case of an error | ||||||||||||
data | String | Empty string | ||||||||||||
data_str | JSON or String | This embedded JSON represents the result of the /alter/table endpoint:
Empty string in case of an error. |