[Qgis-user] Forms, realtions and foreign keys

Karl Magnus Jönsson Karl-Magnus.Jonsson at kristianstad.se
Tue Jun 4 02:14:10 PDT 2019


Hi list!
I have a project with tree tabels stored in PostGIS. One is holding the geometry the other two is holding data related to the first table as child and grandchild. I have set up foreign keys between the tables in the database to be sure that there will be no orphan records. In QGIS there are relations and (sub)forms. When I digitize a new geometry I get the new id from the database (before it's saved, OK) in the form but I can't add any children. I get a database error that says that there are no parent with that ID (and that's true). I have to  press OK to create the feature in QGIS, change tool to identify, find the feature and klick on it to open the form again. Then I can add children. But I haven't saved so there is still no parent. But it works then. It's the same with the grandchild table but then the grandparent form is still open so it's not such a big problem. Anyone got a better way to skip this closing and reopening of the form in the workflow?

Karl-Magnus Jönsson | Gis-Utvecklare
Geografisk information
Miljö- och samhällsbyggnadsförvaltningen
Kristianstads kommun
Besöksadress: Västra Storgatan 12
Postadress: 291 80 KRISTIANSTAD
Telefon: 044-135416 | Mobil: 0733-135416
E-post: Karl-Magnus.Jonsson at kristianstad.se<mailto:Karl-Magnus.Jonsson at kristianstad.se>
www.kristianstad.se<http://www.kristianstad.se/>

Läs mer om hur vi hanterar dina personuppgifter på www.kristianstad.se/personuppgifter<http://www.kristianstad.se/personuppgifter>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190604/f1b9596a/attachment.html>


More information about the Qgis-user mailing list