3
  • QGIS Desktop 3.6.2.
  • PostgreSQL/postGIS: PostgreSQL 10.5 on Windows x86-64
  • Server hosting PostgreSQL: Windows Server 2012 R2
  • Android on Nokia 6.1
  • QField App
  • QGIS Plugins: QFieldSync

I'm trying to save points from a QField project to my PostgreSQL Database.

However, as of now I have only been able to obtain a geopackage format of my points (offline and online). In several posts I found though that it would be possible to have the points transferred into the PostgreSQL directly from the device (in the online mode of QField).

I prepared a QGIS Project and loaded a PostgreSQL table. I set this up as a portable project in Set-tings (set paths to "relative"), packaged in the QFieldSync and transferred to the "An-droid/datach.opengis.qfield/files" folder on my mobile device.

The PostGIS table was added to the project as a new PostGIS layer in the Data Source Manager Settings: (SSL mode "prefer"/ "Allow saving/loading QGIS projects in the database"/ password and username saved).

On my device (online and offline) points were added to the .qgs project. The points were transferred back to my desktop by connecting the phone to the computer and using the QFieldSync plugin to synchronize the folder (ideally I'd want the points to be synchronized without connecting the phone by cable).

What I suspect is that the 'packaging' step in QFieldSync creates the gpkg file to make the Post-greSQL table editable in QField. What settings in QFieldSync I should use for this or am I missing a step?

0

When configuring your project in QFieldSync, there is the possibility to choose for each layer how it's going to be synchronized. By default postgres layers are set to "offline editing", but you can change that to "no action" which means: do not change the data source.

enter image description here

  • Thank you for your quick help. I changed the settings in QFieldSync to "no action" for both the point layer and the basemap. However now I get two other error messages in QField: "PostGIS - Connection to database failed. timeout expired" "QField - Could not save changes. Rolling back." – Patrisha Cook Jul 31 at 8:55
  • Make sure that the login credentials for the database are saved in the project file. – Matthias Kuhn Jul 31 at 9:20
0

The answer from @MatthiasKuhn solved the problem.

The subsequent error messages occurred because the WLAN I used blocks the access to the PostgreSQL DB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.