[Qgis-user] unique id in postgis view

Bernhard Ströbl bernhard.stroebl at jena.de
Sun Jun 17 23:47:48 PDT 2012


Hi Richard,

AFAIK QGIS needs a field which is defined as primary key field in one of 
the tables contained in the view. If this is the case the values in the 
field must be unique, too.

Bernhard

Am 18.06.2012 04:17, schrieb Richard Greenwood:
> 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
>



________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com



More information about the Qgis-user mailing list