title: syntax differences MySQL / PostgresSQL for foreign keys
body: <p>I have used many databases that other people built with foreign keys but have only recently been learning how to include them myself. </p>
  
  <p>Can see from <a href="https://stackoverflow.com/a/12315244/4288043">this answer</a> that the following two statements with and without 'FOREIGN KEY' are equivalent:</p>
  
  <pre><code>author_id INTEGER REFERENCES author(id)
  
  author_id INTEGER,
  FOREIGN KEY(author_id) REFERENCES author(id)
  </code></pre>
  
  <p>Then the following runs perfectly on Postgres but produces an error in MySQL:</p>
  
  <pre><code>CREATE TABLE cities (
          city     varchar(80) primary key,
          location point
  );
  
  CREATE TABLE weather (
          city      varchar(80) references cities(city),
          temp_lo   int,
          temp_hi   int,
          prcp      real,
          date      date
  );
  </code></pre>
  
  <p>(tested here - <a href="https://dbfiddle.uk/" rel="nofollow noreferrer">https://dbfiddle.uk/</a>)</p>
  
  <p>What are the differences in the syntax for this between the two dialects?</p>