title: Use triggers and cause 'out of shared memory' error in PostgreSQL
body: <p>I have a table <code>quotes</code> that comes in 50 new data per minute and now it has over 30 million rows. Originally I have a before trigger on this table (purpose: to divide the table into several smaller ones) and it works perfectly.</p>
  <p>On the other day, I added two other triggers and everything is still fine (the purpose of these two triggers: simply copy the new <code>quotes</code> data to other tables. I calculate some indicators based on these data on other tables). However, a few days later, when I try to perform some simple query on <code>quotes</code>, like
  <code>select count(*) from quotes</code>, it didn't succeed and pop out the error:
  <code>Error 53200: out of shared memory</code>.</p>
  <p>I understand I can increase the <code>max_locks_per_transaction</code>, but I want to ask that why this error didn't appear the first few days after I created the triggers. And also, these newly-added triggers are just to copy the data to other tables, I suppose they use read lock and wouldn't affect the operation (e.g. insertion) of the <code>quotes</code> data, thus shouldn't cause any issue?</p>
  <p>Finally, if I increase the <code>max_locks_per_transaction</code> (but I prefer not), would this error occur in the future (because <code>quotes</code> data will keep coming in by minute)? I'm afraid if I solve the issue now, it'll eventually have the same problem and I have to find other solutions (e.g. use another database) then.</p>
  <p>Thanks for the advice in advance. I'd appreciate any idea on why this error occurs some days after their creations and the possible way to solve this issue (hopefully this can be resolved for good).</p>