title: Does a transaction lock linked tables?
body: <p>I wonder if a transaction which would lock a table will lock all other linked tables too?</p>
  
  <p>Example:</p>
  
  <p>Table 1:</p>
  
  <pre><code>userId | ready
  --------------
      3  |  1
      1  |  0
     ... | ...
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>id | name
  ----------
  0  | John
  1  |  0
  n  | ...
  </code></pre>
  
  <p>Table 1 has a foreign key to table 2.</p>
  
  <p>Table 2's id is a Pkey.</p>
  
  <p>If I update table 1 in a transaction, will it lock table 2?</p>
  
  <p>If I update table 2 in a transaction, will it lock table 1?</p>
  
  <p>[EDIT]</p>
  
  <p>More info:
  Lock escalation: Table
  userId is link by a foreign key to id.</p>
  
  <p>I hope this is enough information.</p>