Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While trying to import a table containing raster data in QGIS , Raster column is not being imported ... I am getting following messages:

  1. Database connection was successful , but the accessible tables could not be determined.

  2. The view 'public.raster_columns' has no column suitable for use as a unique key. Quantum GIS requires that the view has a column that can be used as a unique key. Such a column should be derived from a table column of type int4 and be a primary key, have a unique constraint on it, or be a PostgreSQL oid column. To improve performance the column should also be indexed.

Please help.

Table Used:

  rid serial NOT NULL,
  rast raster,
  filename text,

After adding primary key constraint also , I am getting same error message. I use raster2pgsql command to create a sql file corresponding to the raster tif file. And thereafter pgadmin to create table in postgis from the sql file , Here , rid is primary key and of type serial .

share|improve this question
How are you trying to open the raster layer? – Nathan W Jun 12 '12 at 13:35

Not sure about the first error, but it sounds like you need a primary key column. Looks like that's what you intended 'rid' to be, since it's a serial field, but you still need to explicitly state that it's the PK:

    rid serial PRIMARY KEY,
    rast raster,
    filename text

Note that using PRIMARY KEY implies both UNIQUE and NOT NULL.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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