All Products
Search
Document Center

PolarDB:ST_SetMD5Sum

Last Updated:Mar 28, 2026

Stores a provided 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.
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 metadata of the raster object.

To automatically calculate and store the MD5 hash string when a raster object is saved, configure the following parameter:

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

Examples

Set and immediately verify the MD5 hash string:

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

              st_md5sum
-----------------------------------
 21f41fd983d3139c75b04bff2b7bf5c9

Related functions

  • ST_MD5Sum — retrieves the MD5 hash string stored in a raster object's metadata.