ST_SetAKId

更新时间:
复制 MD 格式

Sets the AccessKey ID used to access a raster object stored in Alibaba Cloud Object Storage Service (OSS).

Prerequisites

The raster object is stored in OSS.

Syntax

raster ST_SetAKId(raster raster_obj, text id, bool valid default true)

Description

ST_SetAKId writes an AccessKey ID into the raster object's metadata so that subsequent operations can access the object in OSS. The function returns the updated raster object.

  • If id is NULL, the existing AccessKey ID is retained. Use this to reset the valid flag without changing the credential.

  • If valid is false, the function skips logon verification.

Parameters

ParameterTypeDefaultDescription
raster_objrasterThe raster object to update.
idtextThe AccessKey ID used to log on to OSS. If NULL, the previous AccessKey ID is used.
validbooltrueSpecifies whether to verify the validity of the logon information.

Examples

Set the AccessKey ID on a raster object, then confirm the value was written:

UPDATE raster_table
SET rast = ST_SetAKId(rast, 'OSS_ACCESSKEY_ID');

SELECT ST_AKId(rast) from raster_table;
     st_akid
------------------
 OSS_ACCESSKEY_ID

The SELECT ST_AKId(...) call confirms the AccessKey ID was stored correctly.