Stores a provided MD5 hash string in the metadata of a raster object.
Syntax
text ST_SetMD5Sum(raster raster_obj, text md5sum)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object. |
md5sum | The 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:
| Parameter | Type | Default | Description |
|---|---|---|---|
ganos.raster.calculate_md5 | Boolean | false | Specifies 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
-----------------------------------
21f41fd983d3139c75b04bff2b7bf5c9Related functions
ST_MD5Sum — retrieves the MD5 hash string stored in a raster object's metadata.