I have loaded a few rasters into the Public schema of a PostGIS 2.0 database. Using the db manager in QGIS 1.8.0 I can add the rasters to the map canvas. After moving the rasters to another schema in the same PostGIS database, I am unable to view the rasters in QGIS. However, moving the raster back to the public schema I am again able to view the rasters in QGIS.

  1. Why is this the case? and
  2. is it possible to fix?

I have tried to load the raster directly into another schema using the someschema.sometable syntax in raster2psql but this returns an error stating that my target schema does not exist, however it does exist in the database. Therefore, I have left out the someschema.sometable syntax resulting in the rasters being stored in the public schema and manually moving them to another schema.


Some additional information. When loading a raster to PostGIS a rid and -i column are created. Only after changing the -i column to rast does QGIS recognise the raster layer (layer is still in public schema). However, the QGIS error "not a valid layer" returns after moving the raster table to another schema.


I have figured out why the raster column heading was named -i. I used the -f parameter without specifying the colummn name. The -I constrained directly followed the -f constrianed therefore resulting in the raster column name being -i.

  • After you move the table to a new schema, did the raster_columns view pick up the change? – HeyOverThere Aug 6 '13 at 17:17
  • I am fairly new to PostGIS and spatial databases. How do I check or verify if the raster_columns picked up the change? – PyMapr Aug 6 '13 at 20:37

When installing a new postgis connection, you can check Only look in the public schema.

If that is set, you can see only tables in that schema.

Unfortunately, you can't change that later in an easy way.

  • Does this apply to raster and vector type tables? My reason for asking, I have successfully moved and viewed a file containing point geometry data from the public schema to other schemas and viewed it in QGIS without any errors. – PyMapr Aug 6 '13 at 14:23
  • I have not yet worked with rasters in Postgis. But your experience looks that way. – AndreJ Aug 6 '13 at 14:37
  • Maybe its not a good idea to move just one table, leaving constraints, indices etc untouched, which might be necessary to work with the raster table. – AndreJ Aug 7 '13 at 8:09
  • That is what I've been thinking. But I am not sure how to move/update the constraints and so forth related to the table. – PyMapr Aug 7 '13 at 10:01
  • Can you add the data to the database with QGIS, instead of raster2pgsql? – AndreJ Aug 7 '13 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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