Changes the storage location of the Object Storage Service (OSS) file that stores a trajectory object's data.
Syntax
bool ST_SetStorageLocation(trajectory traj, text new_path, bool checkValid default true);Parameters
| Parameter | Description |
|---|---|
traj | The trajectory object. |
new_path | The path of the OSS folder in which the trajectory object's data is stored. Only OSS folders are supported. Format: 'OSS://<AccessKey ID>:<AccessKey secret>@<Endpoint>/<Bucket>/<Directory>'. The data is stored as a .gtf file in the specified folder. |
checkValid | Specifies whether to validate the path. Default value: true. If set to true, the system tests whether the specified OSS directory is accessible using your AccessKey pair. If the test fails, an error is returned. |
Description
This function updates the recorded storage location of a trajectory object's data file. The function does not move the original file. Before calling this function, move the OSS folder that contains the trajectory data file to the new location.
After the file is moved, new trajectory data may not be appendable to it. If an error message containing is not appendable is returned, ensure the last data block was uploaded using the OSS AppendObject operation.
Examples
select ST_SetStorageLocation(traj, '<New Path>') from trajs;Output:
st_setstoragelocation
-----------------------
null
null
null
TRAJECTORY EMPTY
(4 rows)