I’m building my first PostgreSQL database. Now it’s just two tables (table A with 1:N relation to table B). Table A has a non-deferrable primary key, while table B has a deferrable primary key. When I try to add table C with a foreign key pointing to primary key of table B (another 1:N relation), PgAdmin refuses to create the table and it returns an error message:
ERROR: cannot use a deferrable unique constraint for referenced table
“table_B”
From my previous searches deferrable primary key seemed to be normal solution. Is it really possible in PgAdmin? Do I need some special trick for this to run?
I use PostgreSQL 9.1.3 and PgAdmin III 1.14.3 on 32 bit Windows XP.
I believe it’s not possible. Quote from PostgreSQL docs about foreign key: