title: Two foreign keys in postgres
body: <p>I am making a junction table. I want it to have 2 separate foreign keys that reference IDs that are in 2 separate tables.</p>
  
  <pre><code>create table user_book (
      id serial primary key NOT NULL DEFAULT nextval('seq_user_prod_pk'::regclass),
      book_id numeric references books (id) NOT NULL,
      user_id numeric NOT NULL references user (id),
      checked bool,
  );
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>ERROR:  syntax error at or near "user"
  LINE 4:     user_id numeric NOT NULL references user (id),
                                                  ^
  
  ********** Error **********
  
  ERROR: syntax error at or near "user"
  SQL state: 42601
  Character: 202
  </code></pre>
  
  <p>Does Postgres not allow 2 foreign keys from two separate tables? </p>
  
  <p>I also tried:</p>
  
  <pre><code>create table user_book (
      id serial primary key NOT NULL DEFAULT nextval('seq_user_prod_pk'::regclass),
      book_id numeric NOT NULL,
      user_id numeric NOT NULL,
      checked bool,
      foreign key (book_id) references book (id)
      foreign key (user_id) references user (id)
  );
  </code></pre>
  
  <p>But got a very similar error. </p>