Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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:

CREATE TABLE everest
(
  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
1  
How are you trying to open the raster layer? –  Nathan W Jun 12 '12 at 13:35
add comment

1 Answer

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:

CREATE TABLE everest
(
    rid serial PRIMARY KEY,
    rast raster,
    filename text
)

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

share|improve this answer
add comment

Your Answer

 
discard

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.