I am receiving an error message in QGIS about my layer in PostGIS being invalid or the connection to the database terminating.
dbname='x' host=x port=5432 user='x' password='x' sslmode=disable key='""' srid=27700 type=LineStringZ table="x"."x" (wkb_geometry) sql= is an invalid layer - not loaded
Erroneous query: SELECT * FROM "x"."x" LIMIT 1 returned 7 [server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.]
Unable to access the "x"."x" relation. The error message from the database was: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
I am using QGIS 2.14.15 64bit LTR on a Windows 7 laptop and PostGIS 9.6 on a remote Windows 2012 server, but received similar errors using 2.18 and PostGIS 9.4.
The connection to the remote server is still active as I have a ping test running but the response times change from 1/2ms up to ~680ms when trying to access a simple data layer.
The data in the PostGIS database is spatially indexed and the table is VACUUM ANALYZED and each table has a Primary Key. So I don't think its the way the data is stored.
The real problem is that it does not happen every time, if I start a new project and add the same layers in the same way QGIS loads the data successfully.
Has anyone encountered this before?