title: PostgreSQL trigger on multiple tables
body: <p>I am working on a project which requires moving data among multiple &quot;stages&quot; (a concept in this project) in PostgreSQL.</p>
  <p>To simplify the problem, let's say we have two stages (stage 1 and 2), and there are three tables <code>t1</code>, <code>t2</code>, and <code>t3</code> in stage 1, and their contents need to be copied to stage 2 when updated.</p>
  <p>The requirement is, the contents of these tables should be copied (by <code>INSERT</code>) to stage 2 only when they are <strong>all</strong> updated in stage 1.</p>
  <p>To fulfil this requirement, I was thinking about using triggers, but it seems that triggers only work for one table, as I read from <a href="https://www.postgresqltutorial.com/postgresql-triggers/introduction-postgresql-trigger/" rel="nofollow noreferrer">here</a>:</p>
  <pre><code>A PostgreSQL trigger is a function invoked automatically whenever an event associated with a table occurs. 
  </code></pre>
  <p>So, are there any other mechanisms to achieve this?</p>