Sets the AccessKey ID and AccessKey secret on a raster object so that PolarDB can read the object's data from Object Storage Service (OSS).
Prerequisites
Before you begin, ensure that you have:
A raster object stored in OSS
Syntax
raster ST_SetAccessKey(raster raster_obj, text id, text key, bool valid default true)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object to update. |
id | The AccessKey ID used to access OSS. If NULL, the existing AccessKey ID is kept. |
key | The AccessKey secret used to access OSS. If NULL, the existing AccessKey secret is kept. |
valid | Specifies whether to verify the validity of the logon information. Default: true. |
Examples
The following example sets credentials on all rows in raster_table and verifies the result:
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