[Qgis-user] unique id in postgis view

Richard Greenwood richard.greenwood at gmail.com
Sun Jun 17 19:17:42 PDT 2012


QGIS wants a unique id on postgis layers, so I created a view that includes:

   ROW_NUMBER() OVER (ORDER BY mytable.ogc_fid ASC) AS row_num,

which seems to be a standard way to create a unique id on a view [1]
but QGIS does not "see" the row_num, i.e. it is not listed in the "No
Suitable Key Column" dialog box that lists the columns in the view and
explains why each is unsuitable.

What am I doing wrong?

Thanks,
Rich


[1] http://gis.stackexchange.com/questions/12233/in-postgis-is-it-possible-to-create-a-view-with-a-unique-id

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Qgis-user mailing list