gdal_translate "PG:host=192.168.1.1 dbname=dataBase user=postgres password=root" -sql "SELECT rast FROM test WHERE rid = 1" your_save_path/output_image.png
07-29
1838
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
gdal_translate "PG:host=192.168.1.1 dbname=dataBase user=postgres password=root" -sql "SELECT rast FROM test WHERE rid = 1" your_save_path/output_image.png