title: How to alter new not null column in Postgresql?
body: <p>I have a table that I want to add new <code>not null varchar(255)</code> column</p>
  
  <p>My query is:</p>
  
  <pre><code>alter table poll_management.DASHLETS add column name varchar(255) not null;
  update poll_management.DASHLETS as dashlet set name = report.name 
  from poll_management.REPORTS as report
  WHERE dashlet.id = report.reportdashletid 
  </code></pre>
  
  <p>But I have an error:</p>
  
  <pre><code>ERROR:  column "name" contains null values
  ********** Error **********
  
  ERROR: column "name" contains null values
  SQL state: 23502
  </code></pre>