Bug report #21148

Save project to PostGreSQL doesn't work with PostGreSQL 9.4 and older

Added by Michel Stuyts 12 months ago.

Status:Open
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:3.4.4 Regression?:No
Operating System:Windows 10 & Ubuntu Linux 16.04 LTS Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28966

Description

The functionality to save a project to PostgreSQL will only work with PostgreSQL versions 9.5 and newer, because:
  • the datatype JSONB was introduced in PostgreSQL 9.4
  • the ON CONFLICT clause was introduced in PostgreSQL 9.5
Problem:
  • It's possible to check "Allow saving/loading QGIS projects in the database" in the Database Connection Settings for PostgreSQL databases older than version 9.5.
  • When this checkbox is checked, it is possible to select Save To -> PostgreSQL in the Menu. After selecting a database, a schema and a project it will show an error that doesn't show the problem is the PostgreSQL version that is being used.
Expected behavior:
  • It's not possible to check the checkbox "Allow saving/loading QGIS projects in the database" for PostgreSQL databases older than version 9.5.
  • Somewhere should be mentioned that this functionality only works with version 9.5 and newer.
Ideal behavior:
  • Saving projects to PostgreSQL also works in older versions of PostgreSQL

Also available in: Atom PDF