All Products
Search
Document Center

PolarDB:ST_SetAccessKey

Last Updated:Mar 28, 2026

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

Prerequisites

The raster object must be stored in OSS.

Syntax

raster ST_SetAccessKey(raster raster_obj, text id, text key, bool valid default true)

Parameters

ParameterDescription
raster_objThe raster object.
idThe AccessKey ID used to log on to OSS. If set to NULL, the existing AccessKey ID is retained.
keyThe AccessKey secret used to log on to OSS. If set to NULL, the existing AccessKey secret is retained.
validSpecifies whether to verify the credentials. Default value: true.

Examples

The following example sets the AccessKey credentials on a raster column, then retrieves the AccessKey ID to confirm the update.

UPDATE raster_table
SET rast = ST_SetAccessKey(rast, 'OSS_ACCESSKEY_ID', 'OSS_ACCESSKEY_SECRET');

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