postgresql, foreign keys + auto-assign primary keys