gacarrillor / AppendFeaturesToLayer

QGIS Processing plugin to add an algorithm for upserting features from a source vector layer to an existing target vector layer.
23 stars 4 forks source link

Changes saved toward a Postgis table? #10

Closed image80 closed 1 year ago

image80 commented 2 years ago

Hello. It was simply to know if it was possible to save modifications toward a postgis table? (Postgresql Postgis serveur). Thanks.

gacarrillor commented 2 years ago

Hello. It was simply to know if it was possible to save modifications toward a postgis table? (Postgresql Postgis serveur).

If you have been granted write access, yes.

If you find any trouble don't hesitate to let us know.

Regards

brusspi commented 1 year ago

Hi,

I am testing your plugin to integrate it into our workflow. Appending works fine. But when choosing update, then it gives an error, saying that the target layer does not support updating. But that's not true. See images with more info. 2023-07-13 11_19_08-Append Features to Layer

Table settings:

2023-07-13 11_20_02-DB Manager

gacarrillor commented 1 year ago

Hi, could you let me know what is the result of running the following Python code in the QGIS Python console?

(Before running it, make sure you have your target PostgreSQL layer selected in the "Layers panel")

caps = iface.activeLayer().dataProvider().capabilities()
bool(caps & QgsVectorDataProvider.ChangeAttributeValues)
bool(caps & QgsVectorDataProvider.ChangeGeometries)

You should get 2 boolean values.

brusspi commented 1 year ago

this is the result

caps = iface.activeLayer().dataProvider().capabilities() bool(caps & QgsVectorDataProvider.ChangeAttributeValues) True bool(caps & QgsVectorDataProvider.ChangeGeometries) False

gacarrillor commented 1 year ago

Great, that's what I was expecting.

Could you test the development version I'm attaching as ZIP and let me know if it fixes the issue you're reporting?

AppendFeaturesToLayer.zip

brusspi commented 1 year ago

Yes, now it works as expected. Great!

gacarrillor commented 1 year ago

Nice, we'll release soon a new public version with this fix included. Closing now as fixed.