ST_SetMD5Sum

更新时间: 2026-03-28 16:39:43

Sets the MD5 hash string in the metadata of a raster object.

Syntax

text ST_SetMD5Sum(raster raster_obj, text md5sum)

Parameters

ParameterDescription
raster_objThe raster object to update.
md5sumThe MD5 hash string to store. Must be exactly 32 characters and contain only digits and lowercase letters.

Description

ST_SetMD5Sum writes the provided MD5 hash string to the raster object's metadata.

To have Ganos compute and store the MD5 hash automatically when a raster object is written, set the ganos.raster.calculate_md5 parameter:

ParameterTypeDefaultDescription
ganos.raster.calculate_md5BooleanfalseSpecifies whether to calculate the MD5 hash string and save it to the metadata when a raster object is stored. Valid values: true | false.
SET ganos.raster.calculate_md5 = true;

Example

Set an MD5 hash on a raster object and read it back with ST_MD5SUM:

SELECT ST_MD5SUM(ST_SetMD5Sum(rast, '21f41fd983d3139c75b04bff2b7bf5c9'))
FROM raster_table
WHERE id = 1;

Output:

              st_md5sum
-----------------------------------
 21f41fd983d3139c75b04bff2b7bf5c9
上一篇: ST_MD5Sum 下一篇: ST_XMin
阿里云首页 云原生数据库 PolarDB 相关技术圈