title: Postgres different default value per child table?
body: <p>Let's say I have two subtables with data loaded via COPY. Is there a way to provide a default value for a column defined as common in the parent table? Something like:</p>
  <pre><code>CREATE TABLE person (
      name            text,
      source          text
  );
  
  CREATE TABLE person_a (
      LIKE person INCLUDING ALL,
      source text default 'dmv'
  ) INHERITS (person);
  
  CREATE TABLE person_b (
      LIKE person INCLUDING ALL,
      source text default 'irs'
  ) INHERITS (person);
  </code></pre>
  <p>That, however, doesn't work. I tells me &quot;source&quot; is already defined. If I remove the LIKE expression, it works, but then I don't get equivalent copies of all the indexes and I need those.</p>
  <p>My use case is that I'm importing (via COPY) data from multiple files. They are the exact same format, just different sources. And I want to keep them in different tables because sometimes I reference specific source and for performance reasons. There's no way with COPY to indicate the source, so I'm doing it with different tables. I still need to distinguish which table each record comes from though if I'm querying against the parent table.</p>
  <p>Is there a way to do this in Postgres 12, to have different default values for an inherited column even with LIKE?</p>
  <p>I'm guessing no, but maybe there's some clever way to do it through some followup after the CREATE TABLE statement?</p>