ST_SetMD5Sum

Updated at:
Copy as MD

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 name of the raster object.
md5sumThe MD5 hash string to set. Must be 32 characters and contain only digits and lowercase letters.

Description

ST_SetMD5Sum writes the provided MD5 hash string to the raster object's metadata. The hash string must be exactly 32 characters and contain only digits and lowercase letters.

To automatically calculate and store the MD5 hash string when a raster object is stored, configure the ganos.raster.calculate_md5 GUC (Grand Unified Configuration) parameter. For details, see ganos.raster.calculate_md5.

Examples

The following example sets the MD5 hash string for the raster object in raster_table where id = 1, then reads it back using ST_MD5SUM to verify.

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

Output:

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