title: How to guarantee a table with exactly one row and one column?
body: <p>Using PostgreSQL 11.5. I need to allow a table to only allow one row and one column in it (not 0 or 2, exactly 1). I feel like <code>ADD CONSTRAINT</code> would be useful but I'm not sure what to do.</p>
  
  <p>I'd like to be able to update this row when needed.</p>
  
  <p>Something to make the following valid:</p>
  
  <pre><code> foo
  -----
   bar
  </code></pre>
  
  <p>But not the following:</p>
  
  <pre><code> foo | baz
  -----+-----
   bar | bin
  -----+-----
       | gar
  </code></pre>