Bug report #19394

Saving QGIS project to PostgreSQL fails when schema contains capital letters

Added by Matt Dallaire over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:3.2 Regression?:No
Operating System:Windows 7 64 Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27222

Description

While attempting to save a new project file to a PostgreSQL schema, if that schema has any capital letters in its name, the process fails with an "Unable to save, possible permissions issue" error dialog. The Projects> Save To> PosgreSQL dialog will properly show capitalization in the Schema drop-down menu. Upon reviewing the PostGIS log, an "erroneous query" shows the CREATE TABLE query (that attempts to create the qgis_projects table) is without quotation marks around the table name.

Example:
2018-07-10T16:09:04 WARNING Erroneous query: CREATE TABLE Basemap.qgis_projects(name TEXT PRIMARY KEY, metadata JSONB, content BYTEA) returned 7 [ERROR: schema "basemap" does not exist
LINE 1: CREATE TABLE Basemap.qgis_projects(name TEXT PRIMARY KEY, me..

Associated revisions

Revision 87bce6ad
Added by Jürgen Fischer over 6 years ago

postgresql provider: also quote schema when creating project table (fixes #19394)

Revision 4895cab4
Added by Jürgen Fischer over 6 years ago

postgresql provider: also quote schema when creating project table (fixes #19394)

(cherry picked from commit 87bce6ad7e19789d248dc20cab47d5d974197040)

History

#1 Updated by Jürgen Fischer over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF