Select to view content in your preferred language

Postgres versioned triggers

569
0
12-19-2017 01:56 PM
by Anonymous User
Not applicable

Hi guys, we encountered as strange problem with triggers in our arcsde postgres db (with Arc 10.5, Postgres 9.5) and can't figure out what to do. Basically, we can create manually a table containing all the data from a versioned table with no problem using: 

CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;

But if we use a trigger function like :

CREATE OR REPLACE FUNCTION sde.function_copy_view()

RETURNS trigger AS $$

BEGIN

   CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;

   return NEW;

END; $$ LANGUAGE plpgsql;

 And this trigger:   

CREATE TRIGGER change_to_view AFTER INSERT OR UPDATE OR DELETE ON sde.view

EXECUTE PROCEDURE sde.copy_of_view();

The resulting table is missing the last change made in ArcMap. Any idea what we are doing wrong?  Thanks guys.

0 Kudos
0 Replies