All Products
Search
Document Center

PolarDB:ST_SetMD5Sum

Last Updated:Mar 28, 2026

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