Sets the 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 to update. |
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 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:
| Parameter | Type | Default | Description |
|---|---|---|---|
ganos.raster.calculate_md5 | Boolean | false | Specifies 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