title: How to log data change in postgresql?
body: <p>This question may seem to be a possible duplicate of some other questions that are related to this topic. I've found some similar questions(some questions were asked years back and discussion on the topic seemed to be almost over). But no feasible solutions were found for my problem. I've a database with plenty of tables with huge amount of data in it. I need to log each and every changes that is happening to the datas that are stored in the tables of the particular database. </p>
  
  <p>For example, I have a table for storing employee details. </p>
  
  <pre><code>id    employeename
   1    ab
  </code></pre>
  
  <p>And, this data is changed to </p>
  
  <pre><code>id    employeename
   1    cd
  </code></pre>
  
  <p>So i need to log this data. </p>
  
  <p>ie, employeename </p>
  
  <blockquote>
    <p>ab </p>
  </blockquote>
  
  <p>is changed to </p>
  
  <blockquote>
    <p>cd</p>
  </blockquote>
  
  <p>in the table employee details</p>
  
  <p>I need to log the data every time a change is made to the contents stored in the tables. Is it really possible? If so, how can I do that? What are the steps involved in it? I'm pretty concerned about the size of the log files in such a case. In such a situation what can be a good alternative? I'm using postgresql8.4. Any good suggestion will help me a lot. Thanks in advance.</p>