title: Alter a column name in a view in PostgreSQL
body: <p>I have a table, x, and a view, x_view, that is based on x, in a PostgreSQL database. </p>
  
  <p>x:</p>
  
  <pre><code>CREATE TABLE x (
  A double precision
  );
  </code></pre>
  
  <p>x_view:</p>
  
  <pre><code>CREATE VIEW x_view AS
   SELECT x.A;
  </code></pre>
  
  <p>I renamed a column in x from A to B.</p>
  
  <pre><code>ALTER TABLE x RENAME COLUMN A to B
  </code></pre>
  
  <p>When I then look at the definition of the view, I see the following:  </p>
  
  <pre><code>SELECT x.B AS A from x;
  </code></pre>
  
  <p>When I do a "SELECT * FROM x_view", the column that should now be labeled B is still labeled A. </p>
  
  <p>Why does the view not automatically change the name of the column when I execute "SELECT * FROM x_view"? Is there any way to force it to do so, besides having to drop and recreate the view?</p>