title: Better to use SERIAL PRIMARY KEY or GENERATED ALWAYS AS IDENTITY for primary key in PostgreSQL
body: <p>Not sure which option is latest best practice? I read on on this tutorial that:</p>
  <p><a href="https://www.postgresqltutorial.com/postgresql-identity-column/" rel="noreferrer">https://www.postgresqltutorial.com/postgresql-identity-column/</a></p>
  <blockquote>
  <p>PostgreSQL version 10 introduced a new constraint GENERATED AS
  IDENTITY that allows you to automatically assign a unique number to a
  column.</p>
  <p>The GENERATED AS IDENTITY constraint is the SQL standard-conforming
  variant of the good old SERIAL column.</p>
  </blockquote>
  <p>In the example they use the identity as the primary key:</p>
  <pre><code>CREATE TABLE color (
      color_id INT GENERATED ALWAYS AS IDENTITY,
      color_name VARCHAR NOT NULL
  );
  </code></pre>
  <p>When you reference this table for a FOREIGN KEY as per the below:</p>
  <pre><code>CREATE TABLE pallet (
      id INT GENERATED ALWAYS AS IDENTITY,
      color_1 REFERENCES color
      color_2 REFERENCES color
  );
  </code></pre>
  <p>Will it know that the identity is the primary key now?:</p>