After adding both

C:\Program Files\PostgreSQL\12\bin
C:\Program Files\PostgreSQL\12\lib

to my windows environmental variables PATH thing, I can't access raster2pgsql:

'raster2pgsql' is not recognized as an internal or external command, operable program or batch file.

I had a look in C:\Program Files\PostgreSQL\12\bin, but I can't actually find raster2pgsql there? Isn't this strange? I would expect it there?

I have postgresql (12.0) and postgis (3.0.0) installed

  • I don't know why, but postgresql12 and postgis3.0.0 don't come with raster2pgsql... Wiped them from disk, reinstalled with postgresql10 + postgis2.5.1 ==> working
    – MaartenVL
    Commented Nov 8, 2019 at 13:36
  • 1
    i've noticed this as well. it might have something to do with postgis_raster being a separate extension in postgis 3.0
    – ziggy
    Commented Nov 8, 2019 at 16:14
  • info.crunchydata.com/blog/…. Raster2pgsql should come with the bundle postgis.net/windows_downloads. How did you make your installation?
    – user30184
    Commented Nov 8, 2019 at 17:20

1 Answer 1


If anyone facing this issue, you can try to install PostGIS again. In windows, you can install it using the Application Stack Builder application. This will install the raster2pgsql and you can add this to environment variable and use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.