Bug report #14211

Cannot add Postgres geometryless layers if postgis extension not present

Added by Tudor Bărăscu almost 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Data Provider/PostGIS
Affected QGIS version:master Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:22213

Description

*How to reproduc*e:

- Create a new PostgreSQL database (don't create the Postgis extension)
- Create at least one table in that database

Bad outcome:

- Connection to that database is successful but no tables are displayed
even though the "list tables with no geometry" option is ticked
- By connecting with DBManager I can see the test table but trying to add it
outputs "Layer is not valid: The layer dbname='..... is not a valid layer and can not be added to the map"

Workaround: Creating the Postgis extension in the database solves all the problems.

Now that I know of the issue, it's not so bad, but I lost enough time as it was
the first time that I cannot see the layers.

Tested on Debian Stretch, QGIS 2.12.3 and master, PostgreSQL 9.4.5

All the best,
Tudor

PS: the logs show:
[[2016-02-02T08:31:10 1 Retrieval of postgis version failed
2016-02-02T08:31:10 1 Your database has no working PostGIS support.
2016-02-02T08:31:32 1 Erroneous query: SELECT postgis_version() returned 7 [ERROR: function postgis_version() does not exist
LINE 1: SELECT postgis_version()
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
]
2016-02-02T08:31:32 1 Retrieval of postgis version failed
2016-02-02T08:31:32 1 Your database has no working PostGIS support.]]


Related issues

Duplicates QGIS Application - Bug report #6891: Connection to non-spatial PostgreSQL Closed 2012-12-18

History

#1 Updated by Giovanni Manghi almost 5 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

duplicate of #6891

Also available in: Atom PDF