Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Conflicts layer fails to add from PostgreSQL #90

Closed
stepanosokin opened this issue Nov 27, 2019 · 8 comments
Closed

Conflicts layer fails to add from PostgreSQL #90

stepanosokin opened this issue Nov 27, 2019 · 8 comments
Labels

Comments

@stepanosokin
Copy link

Hi!
I have PostgreSQL 11.6 and QGIS 3.4. I've made two PostgreSQL server checkouts. After that edited each checkout so that there is a conflict. I update first checkout, it's ok. But when I update second checkout which has a conflict, I get an error because *_conflicts layer cannot be added to the map. It seems to me that the reason is that qgis is trying to use first row - conflict_id - as gid, while it's values are not unique. Can you please help?

@vmora vmora added the bug label Nov 27, 2019
@vmora
Copy link
Contributor

vmora commented Nov 27, 2019

@troopa81 looks like the conflict layers PK is taken from the first layer in the layer three for postgis working copies, I added the bug label because that is not good

@stepanosokin you should be able to workaround the issue by loading the conflict layer manually from qgis (add vector layer).

@stepanosokin
Copy link
Author

@troopa81 looks like the conflict layers PK is taken from the first layer in the layer three for postgis working copies, I added the bug label because that is not good

@stepanosokin you should be able to workaround the issue by loading the conflict layer manually from qgis (add vector layer).

Thanks for answer! That was the first thing I tried. But it still fails, I can add only *_cflt layer, which is not right as I suppose. I tried to delete the record from *_cflt layer. After that I could add *_conflicts layer, then I had to remove a record from it. And as a result there were no edits from this checkout at all after commit. It's confusing.
By the way, is my version of PostgreSQL (11.6) and QGIS (3.4) compatible with the latest release of the plugin?

@stepanosokin
Copy link
Author

However, I tried to add the layer by dragging, maybe I should try to add it from "add Vector layer" as you suggest. I'll try.

@stepanosokin
Copy link
Author

stepanosokin commented Nov 28, 2019

@vmora , I tried to load conflicts layer manually (add Vector layer). I cannot edit the layer's attribute table (delete button doesn't appear). Besides, the Versioning toolbar now says that "layers don't share DB and schema"

@vmora
Copy link
Contributor

vmora commented Nov 28, 2019

@stepanosokin the impossibility to edit may come from the absence of primary key, you can specify the key for qgis in the postgis layer interface.

Normally the conflict layers are in the same schema as the other layers (wich are postgis views in the schema), so I suspect you are not using the right schema.

By the way, is my version of PostgreSQL (11.6) and QGIS (3.4) compatible with the latest release of the plugin?

The plugin has been ported to QGIS 3, so an up-to date 3.4 should work. The plugin as not been tested with PostgreSQL 11 but this is unlikely to cause a problem.

@stepanosokin
Copy link
Author

stepanosokin commented Nov 29, 2019

@vmora , I've managed to add *_conflicts layer layer manually (using versioning_id as a key) and edit it. But after I remove one of conflicting rows from it's table, the layer in checkout itself keeps both records. So after I commit, the head schema also receives both objects. If I delete one of conflicting rows in the checkout layer itself, than it's ok. But why do I have to do it twice?

@stepanosokin
Copy link
Author

Update: seems to work better if to make some edits to checkout layer after resolving a conflict

@SebastienPeillet
Copy link

Project migrated to : https://gitlab.com/Oslandia/qgis/qgis-versioning

@delhomer delhomer closed this as completed Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants