title: Adding an one-out-of-two not null constraint in postgresql
body: <p>If I have a table in Postgresql:</p>
  
  <pre><code>create table Education ( 
      id                  integer references Profiles(id),
      finished            YearValue not null,
      started             YearValue,
      qualification       text,
      schoolName          text,
      studiedAt           integer references Organizations(id),
      primary key (id)
  );
  </code></pre>
  
  <p>I need to make a constraint so that either <code>schoolName</code> or <code>studiedAt</code> needs to not be null (one of them has to have information in it).</p>
  
  <p>How do I do this?</p>