Returns the MD5 hash of a raster object.
Syntax
text ST_MD5Sum(raster raster_obj)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object to query. |
Description
ST_MD5Sum looks up the MD5 hash in the raster object's metadata and returns it directly if found. If the MD5 hash cannot be found in the metadata, the function returns NULL. The function then calculates the MD5 hash based on the raster object's path in Object Storage Service (OSS).
By default, MD5 hashes are not computed or stored when raster objects are written to OSS (ganos.raster.calculate_md5 = false).
To control this behavior, configure the following parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
ganos.raster.calculate_md5 | boolean | false | Whether to compute and store the MD5 hash in metadata when a raster object is written to OSS. |
ganos.raster.md5sum_chunk_size | integer | 10 | The amount of data buffered per read when computing the MD5 hash, in MB. Valid values: 1–256. |
Example: enable MD5 computation at write time
SET ganos.raster.calculate_md5 = true;
SET ganos.raster.md5sum_chunk_size = 20;Example
SELECT ST_MD5SUM(rast)
FROM raster_table
WHERE id = 1;Result:
st_md5sum
-----------------------------------
21f41fd983d3139c75b04bff2b7bf5c9