title: Can I use Inheritance of PostgreSQL for getting a particular set of columns in many tables in one database?
body: <p>In Postgresql 10 , I want to have same set of columns for audit purpose in all transactional tables of a particular database with same Foreign Key Constraints.</p>
  
  <p>I am thinking of creating a master table with the set of 4 columns:</p>
  
  <pre><code>createdBy  createdOn  updatedBy  updatedOn
  </code></pre>
  
  <p>Then inherit all transactional tables from this master table.</p>
  
  <p>Is this the right approach and is inheritance suited for this? When it comes to storage of data, how it works behind the scenes when I insert records into the derived/child tables. What happens when data is deleted from child tables. Can I lock my master table so that no one accidentally deletes any records from master table ?</p>