title: How do I interpret this Rails/PostgreSQL error?
body: <p>I'm getting the following error in Rails with PostgreSQL:</p>
  
  <pre><code>ActiveRecord::StatementInvalid:
         PG::NotNullViolation: ERROR:  null value in column "created_at" violates not-null constraint
         DETAIL:  Failing row contains (4, null, null, 2014-05-08 13:27:56.002747, f, null, null, f, f).
         : INSERT INTO "elements" ("updated_at") VALUES ('2014-05-08 13:27:56.002747') RETURNING "id"
  </code></pre>
  
  <p>I gather it's saying I'm attempting to insert the value of <code>2014-05-08 13:27:56.002747</code> into the <code>updated_at</code> column of a row representing one instance of <code>Element</code>. Is that correct?</p>
  
  <p>This should be fine, as the value looks like a valid date/time to me — correct?</p>
  
  <p>I also gather it's saying <code>created_at</code> can't be <code>null</code> but that seems crazy because doesn't every instance automatically get a <code>created_at</code> value equal to the date/time at which it was created?</p>
  
  <p>And what does <code>RETURNING "id"</code> mean?</p>
  
  <p>I'm happy to continue debugging my app myself, but if anyone could unpack this error message for me it would be a great headstart. (Especially as the stack trace is not making it clear where the error is being created.)</p>