title: Change column name from aggregate function default postgresql
body: <p>I created a (big) table like so:</p>
  
  <pre><code>create table names_and_pics as (
      select e.emp_name, e.dept, max(p.prof_pic)
      from e.employees
      left join profiles p
        on e.emp_id = p.emp_id )
  
  select * from names_and_pics;
  
  emp_name | dept | max(p.prof_pic)
  Dan      | IT   | 1234.img 
  Phil     | HR   | 3344.img 
  ...
  </code></pre>
  
  <p>Because I forgot to give the 3rd field a name, I need to rename it now to "img_link" The syntax I've been trying is</p>
  
  <p><code>alter table names_and_pics rename max(p.prof_pic) to img_link;</code></p>
  
  <p>That gives the following error:</p>
  
  <blockquote>
    <p>Syntax Error at or near "("</p>
  </blockquote>
  
  <p>Any ideas how to fix this?</p>