全部產品
Search
文件中心

PolarDB:ST_SetAccessKey

更新時間:Jul 06, 2024

設定外部儲存軌跡的AccessKey。

文法

trajectory ST_SetAccessKey(trajectory traj, text akid, text aksecret, bool checkvalid default true);

參數

參數名稱描述
traj軌跡對象。
akid訪問OSS的AccessKeyId。
aksecret訪問OSS的AccessKeySecret。
checkvalid是否需要驗證正確性,預設為true。如果為true,則嘗試用新設定的AccessKey訪問OSS,如果訪問失敗則報錯。

描述

重新設定訪問外部儲存時的AccessKey。

從OSS外部儲存讀取軌跡時,需要提供AccessKey,每個AccessKey分為AccessKeyId和AccessKeySecret(可以理解為使用者名稱和密碼)。

樣本

select ST_SetAccessKey(traj, '<OSS_USER>', '<OSS_PWD>') from trajs;
                                                                                                                                                                                                                                            st_setaccesskey                                                                                                                                                                                                                                             
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 {"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2 0,33.042158099636 36.832684322819 0,47.244002354518 47.230026333034 0,64.978971942887 60.618813472986 0,77.621717839502 78.012496630661 0,80 78 0)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
 {"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2 0,33.042158099636 36.832684322819 0,47.244002354518 47.230026333034 0,64.978971942887 60.618813472986 0,77.621717839502 78.012496630661 0,80 78 0)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
 {"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2,33.042158099636 36.832684322819,47.244002354518 47.230026333034,64.978971942887 60.618813472986,77.621717839502 78.012496630661,80 78)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
 TRAJECTORY EMPTY
(4 rows)