title: Getting SQL state: 25P02 while trying to update a table with data from another
body: <p>I am using a PostgreSQL DB. I have two tables, namely <code>company</code> and <code>bl_location</code>. I have a field <code>location_id</code> in both tables. Now I am trying to copy the value of <code>location_id</code> from <code>bl_location</code> to <code>company</code>. The primary key of <code>company</code> is <code>company_id</code> and it is stored in <code>bl_location</code> too. I am trying the following query: </p>
  
  <pre><code>UPDATE company 
      SET location_id = bl_location.location_id 
  from bl_location  
  where company.company_id = bl_location.company_id;
  </code></pre>
  
  <p>using the syntax I found online: </p>
  
  <pre><code>update table1
  set col1 = . . .
  from table2
  where table1.id = table2.table1_id
  </code></pre>
  
  <p>But I am getting the following in the console of the <code>pgAdmin</code> tool:</p>
  
  <pre><code>ERROR:  current transaction is aborted, commands ignored until end of transaction block
  
  ********** Error **********
  
  ERROR: current transaction is aborted, commands ignored until end of transaction block
  SQL state: 25P02
  </code></pre>
  
  <p>I cannot figure out what is wrong with my query.</p>