<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Postgres versioned triggers in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/postgres-versioned-triggers/m-p/392844#M15258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if we use a trigger function like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE OR REPLACE FUNCTION sde.function_copy_view()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RETURNS trigger AS $$&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BEGIN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return NEW;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END; $$ LANGUAGE plpgsql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And this trigger:&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TRIGGER change_to_view AFTER INSERT OR UPDATE OR DELETE ON sde.view&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXECUTE PROCEDURE sde.copy_of_view();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting table is missing the last change made in ArcMap. Any idea what we are doing wrong?&amp;nbsp; Thanks guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Dec 2017 21:56:22 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-12-19T21:56:22Z</dc:date>
    <item>
      <title>Postgres versioned triggers</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/postgres-versioned-triggers/m-p/392844#M15258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if we use a trigger function like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE OR REPLACE FUNCTION sde.function_copy_view()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RETURNS trigger AS $$&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BEGIN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE TABLE sde.copy_of_view AS SELECT * FROM sde.view;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return NEW;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END; $$ LANGUAGE plpgsql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And this trigger:&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TRIGGER change_to_view AFTER INSERT OR UPDATE OR DELETE ON sde.view&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXECUTE PROCEDURE sde.copy_of_view();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting table is missing the last change made in ArcMap. Any idea what we are doing wrong?&amp;nbsp; Thanks guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2017 21:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/postgres-versioned-triggers/m-p/392844#M15258</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-12-19T21:56:22Z</dc:date>
    </item>
  </channel>
</rss>

