[QGIS-Developer] Bug in DB Manager > Versioning?

Jürgen E. Fischer jef at norbit.de
Thu Jan 25 11:39:16 PST 2018


Hi Paolo,

On Thu, 25. Jan 2018 at 20:29:00 +0100, Paolo Cavallini wrote:
> ALTER TABLE "public"."province_hist" ADD "id_hist" serial, ADD
> "time_start" timestamp, ADD "time_end" timestamp;
> 
> ALTER TABLE "public"."province_hist" DROP CONSTRAINT
> "province_hist_pkey", ADD PRIMARY KEY ("id_hist");
> 
> Then it adds only the original id, no PK, and not the new PK to the view:
> 
> CREATE VIEW "public"."province_hist_current" AS SELECT
> "geom","provincia","id" FROM "public"."province_hist" WHERE "time_end"
> IS NULL;
> 
> As a result, the view does not have an unique field, and cannot be loaded.

id should still be unique for all current rows, shouldn't it?  So you just have
to specify that id is the key (would be the same with id_hist).


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 release manager (PSC)  Germany                    IRC: jef on FreeNode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180125/540df223/attachment.sig>


More information about the QGIS-Developer mailing list