title: How can I add a column that doesn't allow nulls in a Postgresql database?
body: <p>I'm adding a new, "NOT NULL" column to my Postgresql database using the following query (sanitized for the Internet):</p>
  
  <pre><code>ALTER TABLE mytable ADD COLUMN mycolumn character varying(50) NOT NULL;
  </code></pre>
  
  <p>Each time I run this query, I receive the following error message:</p>
  
  <blockquote>
  <pre><code>ERROR:  column "mycolumn" contains null values
  </code></pre>
  </blockquote>
  
  <p>I'm stumped.  Where am I going wrong?</p>
  
  <p>NOTE: I'm using pgAdmin III (1.8.4) primarily, but I received the same error when I ran the SQL from within Terminal.</p>