Issues with Postgres layers that have multiple geometry columns #53892
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
PostGIS data provider
Regression
Something which used to work, but doesn't anymore
What is the bug or the crash?
I've noticed some very odd behaviour working with Postgres layers with multiple geometry columns in QGIS.
Main issue:
When editing a Postgres table in QGIS that has multiple geometry columns, if a user does not have UPDATE permissions on all geometry columns, the user will not be able to save edits to other columns that they have been granted UPDATE permissions on. No edits are being made to the geometry columns in these cases.
There are no issues for the same user if they execute a query to make that update using the PostgreSQL execute SQL tool in QGIS or through a GUI like pgAdmin or DBeaver.
The only solution I have found that does not require granting UPDATE permissions is to set the additional geometry columns in QGIS to not be editable - either through the Editable checkbox in the Attributes Form properties, or making the column hidden in the Attribute form.
Secondary issue:
Geoprocessing tools like Buffer or Reproject Layer also fail on Postgres tables that have multiple geometry columns. The output file type does not seem to matter.
Steps to reproduce the issue
Sample data is attached: sample_data.zip
Starting from Step 6, if you then try running geoprocessing tools like Buffer or Reproject Layer, this error will pop up:
Versions
QGIS version
3.26.0-Buenos Aires
QGIS code revision
0aece28
Qt version
5.15.3
Python version
3.9.5
GDAL/OGR version
3.5.0
PROJ version
9.0.1
EPSG Registry database version
v10.064 (2022-05-19)
GEOS version
3.10.3-CAPI-1.16.1
SQLite version
3.38.1
PDAL version
2.3.0
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.6
QScintilla2 version
2.13.1
OS version
Windows 10 Version 2009
Active Python plugins
db_manager
0.1.20
processing
2.12.99
Supported QGIS version
New profile
Additional context
Storing this data in two separate Postgres tables is not an ideal solution, as we have users who need to switch between spatial reference systems while viewing and editing attributes in this data.
The geometry columns are the same type (Point), just different SRIDs.
The text was updated successfully, but these errors were encountered: