Bug report #17601

QGIS 2.18.14 'save as' from PostGIS table not working

Added by Mark Falkenberg over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Vectors
Affected QGIS version:2.18.14 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25498

Description

Issue:
I have my layer 'footprints2017' in a PostGIS table. (image1)
I then select a number of the footprints. Here 28.453 footprints (image1)
image1
I then right-click and save-as. Choose only to save selected features. Then press OK. (image2)
image2
This immediately returns a empty file. (image3)
image3
If I only save a small number of features... no problem, but once I reach the tens of thousands if returns empty shapefiles.

QGIS_error2.png - image2 (22.4 KB) Mark Falkenberg, 2017-12-01 11:34 AM

QGIS_error.png - image1 (1.11 MB) Mark Falkenberg, 2017-12-01 11:34 AM

QGIS_error3.png - image3 (1.11 MB) Mark Falkenberg, 2017-12-01 11:34 AM

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Data Provider/PostGIS to Vectors
  • Status changed from Open to Feedback

1) please provide a dump of your table
2) use a full path in output name instead of just "temp".

Cannot replicate here, not even with very large data (just saved this way a 1gb shp from postgis).

#2 Updated by Mark Falkenberg over 6 years ago

Thank you for the fast reply!

Have tried using full path.
I am not certain what you mean by 'dump of your table'. please specify.
The 'footprint2017' table is several GB when stored locally as a shapefile, can't really upload the whole thing. The 'temp' file is just empty.

And just for added information. We are 6 people using QGIS in the office and all six of us have this issue when trying to save more than ~10.000 features from our various databases.

#3 Updated by Giovanni Manghi over 6 years ago

Mark Falkenberg wrote:

Thank you for the fast reply!

Have tried using full path.
I am not certain what you mean by 'dump of your table'. please specify.
The 'footprint2017' table is several GB when stored locally as a shapefile, can't really upload the whole thing. The 'temp' file is just empty.

I mean a backup of the table create with the "pg_dump" tool, so we can restore it here locally and try to replicate the issue. Likely you will have to use an external service to link it here, as there is a 5mb limit for attachments.

And just for added information. We are 6 people using QGIS in the office and all six of us have this issue when trying to save more than ~10.000 features from our various databases.

understand, but I also said that here there are no issues in saving multiple gb vectors (to shape, geopackage, etc.) on different platforms (linux, windows) using postgis data as sources.

#4 Updated by Mark Falkenberg over 6 years ago

Before i start with the pg_dump I just noticed this;

When attempting to save i get the following
Log message panel message for PostGIS panel:
------------------------------------------------------------------------------------------------------------------------------------------------------
2017-12-01T12:51:46 1 NOTICE: WARNING: there is no transaction in progress
2017-12-01T12:58:19 1 invalid PostgreSQL layer
2017-12-01T13:00:14 1 Query: DECLARE qgis_5 BINARY CURSOR FOR SELECT st_asbinary("geom",'NDR'),"imageid"::text FROM "public"."fp_cap_test2" WHERE ("imageid"::text='2017_81_10_2_0029_00000449'
OR "imageid"::text='2017_81_10_4_0006_00001696'
OR "imageid"::text='2017_81_10_4_0007_00001870'
OR "imageid"::text='2017_81_09_1_0021_00000674'... so on and so on...
...
...
...
OR "imageid"::text='2017_81_09_1_0021_00000680')
Result: 7 (ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.)

2017-12-01T13:00:19 1 Query: CLOSE qgis_6 returned 7 [ERROR: cursor "qgis_6" does not exist]
2017-12-01T13:00:19 1 NOTICE: NOTICE: there is no transaction in progress
------------------------------------------------------------------------------------------------------------------------------------------------------

Any info on how I increase the 'max_stack_depth'? Googling I only found a entry in french :)

#5 Updated by Regis Haubourg over 6 years ago

Hi,
See https://www.postgresql.org/docs/9.4/static/runtime-config-resource.html

I think you have issues with your postgresql.conf. Maybe you can share it (though this is not a QGIS specific issue)?

#6 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Reopen if by chance you find that this is really a QGIS issue (which at the moment does not seems the case).

Also available in: Atom PDF