I compiled and installed the current QGIS master as usual and I imported some raster data into my postgres 9.3 database with postgis 2.0.2 extension. Whenever I try to import the raster data into qgis using the database manager, I get this message:

GDAL provider: Cannot get GDAL raster band: 
Raster layer: Provider is not valid (provider: gdal, URI: PG: dbname=gis host= user=xxx password=xxx port=5432 mode=2 schema=public table=elevation

In the command line, I get

ERROR 1: Computed PostGIS Raster dimension is invalid. You've probably specified unappropriate resolution.

I have no idea where to search for the error.

I just moved to Postgis 2.1.2 and the same problem is seen there.

  • 3
    It is not a problem with the postgis version. I use postgis 2.1.3 on Debian and QGIS 2.1 and it worked perfectly but using the same database with QGIS 2.4 I get the same error message.
    – Ronny
    Commented Aug 5, 2014 at 12:09
  • 1
    I'm on QGIS 2.4 with Xubuntu 14.04, PostgreSQL 9.1 and PostGIS 2.X and I get the same issue. Need some solutions, or means tosome solutions. Commented Sep 25, 2014 at 3:27

1 Answer 1


I got the same error in QGIS 2.8.5 with Ubuntu and solve the problem adding constraints on my raster with the sql sentence below.

Note that the last three parameters should be passed exactly as it is written below. You don't have to change them. Just change the first three: raster table schema, raster table name, raster table field.

SELECT AddRasterConstraints('<schema>'::name, '<raster table>'::name, '<raster field, ex: rast>'::name,'srid','out_db','extent')

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.