[postgis-users] unable to modyfy records after trigger execution

Pietro Rossin pierigis at gmail.com
Thu Oct 16 05:16:54 PDT 2014


Hello everybody
I'm absolutely not a postgresql/postgis guru
I need to populate a postgresql/postgis table with microsoft access.
In Qgis I add the geometries and then I use MS Access to add most of the
tabular data.

To map the user who makes the last modification to the values I made a
trigger function like this:

CREATE OR REPLACE FUNCTION myschema.myfunction()
  RETURNS trigger AS
$BODY$
BEGIN
	new.user_modif =current_user;
	new.data_modif = now();
	RETURN NEW;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION myschema.myfunction()
  OWNER TO myself;
 

It is invoched by this trigger:

CREATE  TRIGGER set_user_date_mod
  BEFORE UPDATE
  ON myschema.mytable
  FOR EACH ROW
  EXECUTE PROCEDURE myschema.myfunction();



This trigger works and if I modify any value in the table user and timestamp
are correctly  written at theyr place..

Then I encounter problems in other modification I want to perform on some
previously modificated rows..
Access can't save modifications and tells me there is another user (myself)
who has done some modification on the records that could be lost, and I
can't save..

Otherwise I can modify any other record.. And when modifyed that record is
not updatable anymore and so on..

Where is the problem?
I think there shoul be some transaction that dont come to the end and the
record remains "appended"..

Is it possible??

Any solution?
Thanks
Pietro



--
View this message in context: http://postgis.17.x6.nabble.com/unable-to-modyfy-records-after-trigger-execution-tp5007158.html
Sent from the PostGIS - User mailing list archive at Nabble.com.


More information about the postgis-users mailing list