[Qgis-developer] Postgis Spatial Views - problems with primary keys

Alexandre Neto senhor.neto at gmail.com
Mon Mar 10 07:39:31 PDT 2014

Hi Jürgen,

On Mon, Mar 10, 2014 at 12:30 PM, Jürgen E. <jef at norbit.de> wrote:

> QGIS just offers all integer fields as candidate.  It doesn't select any.

If you use add Postgis layer dialog, it uses one of integer fields by
default in the primary key column (not always the same).

> I think that changed before 2.0.1. QGIS used to identify which view field
> are
> primary keys in the underlying tables, but that makes sense if the view is
> a
> selection of that table, which is just a very small subset of possible
> views.
> E.g. for joins between two tables being a primary key in one of the table,
> doesn't mean that the attribute is also unique in the view.

I have a Portuguese user that says that this 2.0.1 is working as before
(and that he won't change to 2.2 until it gets "fixed"), but personally I
can't confirm this.

What was the downside of the later behavior? I.e. qgis identifying several
primary keys and try to guess what to use? Even if it is a small subset of
possible views, I think it would make user's life easier in some cases.

Also, as it is now, unless the view only have one integer field, the
browser became useless for adding views. We should, at least, change the
error message, informing the user that he must select a primary key
manually (only possible in the add postgis layer dialog).

Thanks for your answer.


> Jürgen
> --
> Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-31
> Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
> Software Engineer         D-26506 Norden
> http://www.norbit.de
> QGIS PSC member (RM)      Germany                      IRC: jef on FreeNode
> --
> norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
> Rheinstrasse 13, 26506 Norden
> GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140310/187e192f/attachment.html>

More information about the Qgis-developer mailing list