title: PostgreSQL Error: Relation already exists - FOREIGN KEY in CREATE TABLE
body: <p>I am making a table as follows:</p>
  
  <pre><code>CREATE TABLE creator.lists
  (
      _id bigserial PRIMARY KEY NOT NULL,
      account_id bigint NOT NULL,
      created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
      display_name text DEFAULT '',
      name text DEFAULT '',
      extra jsonb,
  
      FOREIGN KEY (account_id)
          REFERENCES creator.accounts (_id)
              ON DELETE CASCADE
  );
  </code></pre>
  
  <p>but I get this error:</p>
  
  <pre><code>ERROR:  relation "account_id_index" already exists
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>CREATE INDEX
      account_id_index
  ON
      creator.lists
  (
      account_id
  );
  </code></pre>
  
  <p>How do I create an index on the foreign key? I am running v11.1</p>
  
  <p><strong>Just a note</strong>, that I've also ran a similar command before for another table:</p>
  
  <pre><code>CREATE INDEX
      account_id_index
  ON
      creator.contacts
      (
          account_id
      );
  </code></pre>
  
  <p>I don't suppose that index names need to be unique between tables?</p>