Bug report #8005

Unable to Add Features to PostGIS Layer in Quantum GIS 1.9

Added by Brett Z over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16855

Description

I am testing out Quantum GIS 1.9-master and I've noticed that I am only able to add features to a PostGIS 2.0 layer if that layer is in a schema with the same name as my login. For example, if my login names is "brett", I am able to add features to the table brett.test_table, but not fred.test_table (regardless of the table permissions (I do have INSERT, UPDATE, DELETE permissions on tables in both schemas). Strangely enough, I am able to perform updates to features in tables in other schemas (i.e. I can move or reshape a feature).

I am able to add features fine to tables in other layers using Quantum GIS 1.8 (so I don't think it's a PostgreSQL permissions issue).


Related issues

Duplicates QGIS Application - Bug report #7961: Add feature remain deactivated when toogle editing is on Closed 2013-05-31

Associated revisions

Revision 6b0ce086
Added by Jürgen Fischer over 6 years ago

fix activateDeactivateLayerRelatedActions (fixes #8005)

History

#1 Updated by Regis Haubourg over 6 years ago

I guess you have things to tune in your search path, unclear what.
Default postgres search path of roles add a user variable:

ALTER ROLE groupe_lecture_seule
SET search_path = "user", public, ouv, zon, ref, services, ext, dce, temp, inv;
COMMENT ON ROLE groupe_lecture_seule IS 'lecture_seule';

régis

#2 Updated by Brett Z over 6 years ago

Thank you for the suggestion. My search path is the default: "$user", public. I've tried changing it around, but unfortunately this doesn't work. Regardless, the current setup of my PostgreSQL database allows me to add features without issue in QGIS 1.8, but not in QGIS 1.9, so it would seem it's either a change in behaviour from 1.8 to 1.9, or a bug.

#3 Updated by Brett Z over 6 years ago

I've investigated this issue further, and found that regardless of the schema the table is in, I can only add features to tables that I own. I cannot add features to any table that another user owns, even if I have full privileges (INSERT, UPDATE, DELETE). I even tried this out with a new install of PostgreSQL and PostGIS 1.5 on a test server and had the same issue.

#4 Updated by Giovanni Manghi over 6 years ago

Brett Z wrote:

I've investigated this issue further, and found that regardless of the schema the table is in, I can only add features to tables that I own. I cannot add features to any table that another user owns, even if I have full privileges (INSERT, UPDATE, DELETE). I even tried this out with a new install of PostgreSQL and PostGIS 1.5 on a test server and had the same issue.

are you using a recent qgis master revision? a similar bug was fixed a while ago.

#5 Updated by Brett Z over 6 years ago

I have tested this using the QGIS weekly build from June 3, downloaded here: http://qgis.org/downloads/weekly/
I've also tested this today in Ubuntu 13.04 with the nightly build of QGIS (deb http://qgis.org/debian-nightly raring main) and had the same issue.

Giovanni Manghi wrote:

Brett Z wrote:

I've investigated this issue further, and found that regardless of the schema the table is in, I can only add features to tables that I own. I cannot add features to any table that another user owns, even if I have full privileges (INSERT, UPDATE, DELETE). I even tried this out with a new install of PostgreSQL and PostGIS 1.5 on a test server and had the same issue.

are you using a recent qgis master revision? a similar bug was fixed a while ago.

#6 Updated by Giovanni Manghi over 6 years ago

  • Priority changed from High to Severe/Regression
  • Target version set to Version 2.0.0

I can confirm the issue:

the owner of the table has the following capabilities:

Add Features, Delete Features, Change Attribute Values, Add Attributes, Delete Attributes, Fast Access to Features at ID, Change Geometries

while the non owner, but with all kind of grants results as:

Add Features, Delete Features, Change Attribute Values, Fast Access to Features at ID, Change Geometries

Seems a regression and so I'll tag this as blocker. Don't kill me if I'm wrong, please.

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

  • Status changed from Open to Closed

Also available in: Atom PDF