Returns the MD5 hash string 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 string in the raster object's metadata. If no MD5 hash string is found in the metadata, the function returns NULL for data-internal raster objects. For raster objects stored in Alibaba Cloud Object Storage Service (OSS), the function calculates the MD5 hash string from the OSS path.
To pre-compute the MD5 hash string at storage time and cache it in the metadata, configure the following GUC parameters:
| Parameter | Type | Description | Valid values | Default |
|---|---|---|---|---|
ganos.raster.calculate_md5 | boolean | Specifies whether to calculate and save the MD5 hash string to metadata when the raster object is stored. | true | false | false |
ganos.raster.md5sum_chunk_size | integer | The chunk size, in MB, for each read operation when calculating the MD5 hash string. | 1–256 | 10 |
Example configuration:
SET ganos.raster.calculate_md5 = true;
SET ganos.raster.md5sum_chunk_size = 20;Examples
Query the MD5 hash string of a raster object:
SELECT ST_MD5Sum(rast)
FROM raster_table
WHERE id = 1;Result:
st_md5sum
-----------------------------------
21f41fd983d3139c75b04bff2b7bf5c9