title: behaviour of LOCK TABLE table_name IN EXCLUSIVE MODE in oracle v/s Postgres
body: <p>After applying the lock on table using below command in oracle DB:</p>
  <pre><code>$db-&gt;do(&quot;LOCK TABLE table_name IN EXCLUSIVE MODE&quot;) or ataerr::dbexecute($db);
  </code></pre>
  <p>I updated one of it's index tablespace  using below command:</p>
  <pre><code>$db-&gt;do(&quot;ALTER INDEX i_charge MODIFY DEFAULT ATTRIBUTES TABLESPACE tablespace2&quot;) or ataerr::dbexecute($db);
  </code></pre>
  <p>Since the table was locked i got following error:</p>
  <blockquote>
  <p>The current partition operation has failed with ORACLE error: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired (DBD ERROR: error possibly near &lt;<em>&gt; indicator at char 12 in 'ALTER INDEX &lt;</em>&gt;I_CHARGE MODIFY DEFAULT ATTRIBUTES TABLESPACE CHARGE_IND').<br>
  Retrying in 2 seconds.</p>
  </blockquote>
  <p>I am trying to do same operation in postgres DB, but it is <strong>not throwing any error</strong>.</p>
  <p>I have updated index tablespace using following command in postgres:</p>
  <pre><code>ALTER INDEX i_charge SET TABLESPACE CHARGE;
  </code></pre>
  <p>I have inspected lock on table using following query:</p>
  <pre><code>SELECT * 
  FROM pg_locks pl 
  LEFT JOIN pg_stat_activity psa
      ON pl.pid = psa.pid;
  </code></pre>
  <p>Output from above query shows the is AccessShareLock held on the table.</p>
  <p>Please help me what should I do so that it throws error message in Postgres?</p>