Why can't temporary tables references non-temp tables in PostgreSQL? When I run the following
CREATE TABLE foo ( a int PRIMARY KEY );
CREATE TEMP TABLE bar ( a int REFERENCES foo );
I get,
ERROR: constraints on temporary tables may reference only temporary tables
I thought this used to work, so I went back to PostgreSQL 8.4 and I see even then it used to error,
ERROR: cannot reference permanent table from temporary table constraint
Why is this though? Why can't a temporary table reference a non-temporary table.