[Qgis-developer] Concurrent editing- postGIS/Oracle Spatial

Bernhard Ströbl bernhard.stroebl at jena.de
Tue Dec 2 03:11:30 PST 2014


no solution but some thoughts. You could store all changes of each user 
into a separate table and create a dedicated view for each user 
combining the changed datasets in his/her user table and those unchanged 
by this user from the original table.
The user table would have a field user_action::char(1) with values i, u 

SELECT data FROM usertable
WHERE user_action != 'd'
SELECT data FROM originaltable
WHERE id not in (SELECT DISTINCT id FROM usertable);
--assuming id is the primary key

The user would edit this view and the view would be made editable 
through rules [1].

Once the job is completed the changes can be applied to the original 
table and deleted from the user table (by means of a DB function). You 
would have to make sure that deletes are executed first, then inserts 
and then updates. Maybe a timestamp of the change is useful to have only 
the last update executed for each dataset.

The main problem I see is concurrent editing of the same feature (e.g. 
user A changes feature 1 and in the meanwhile user B deletes it, then 
the application of A's changes has no effect). There used to be a plugin 
by Horst Düster called "PG Version" to handle this but I could not just 
find it.

Hope this helps


[1] http://www.postgresql.org/docs/9.3/static/rules.html

Am 02.12.2014 09:05, schrieb Manoj:
> Hello All,
> unable to post from original id, so trying my luck with another.
> I need a suggestion to implement a workflow in QGIS.
> Requirement is that edits are not visible to other user until field work
> is over which means edits for a user is stored in temp table or in the
> same table differentiated by a attribute.
> So say I have road layer which is visible to all.
> Any user work on road layer, their edits are stored in road_temp table.
> Only owner user is allowed to see the new edits. The entry in db is
> having user’s job id to find out.
> Once he marks the job completion then others can also see.
> So how I can make QGIS to show a combined view of two tables based on
> the job opened or just existing +job data  if stored in a same table?
> For example-
> Existing data is – A, B, C, D
> User A-  Job1- Created – E, Deleted C
> So he his map showing- A,B, D, E
> UserB comes- He still sees A, B, C, D.
> He created another job- and added F.
> So userB in his map viewing- A,B, C, D, F
> User A- marked his job to complete.
> Now UserB  in his map should see- A,B, D,E, F
> Or which library is rendering the feature by getting from db (postGIS or
> oracle)?
> Thanks

__________ Information from ESET Mail Security, version of virus signature database 10811 (20141202) __________

The message was checked by ESET Mail Security.

More information about the Qgis-developer mailing list