Please check the below findings on GTT. -- Scenario 1: Under "information_schema", We are not allowed to create "temporary table", whereas we can CREATE/DROP "Global Temporary Table", is it expected ?
postgres=# create global temporary table information_schema.temp1(c1 int); CREATE TABLE
postgres=# drop table information_schema.temp1 ; DROP TABLE
-- Scenario 2: Here I am getting the same error message in both the below cases. We may add a "global" keyword with GTT related error message.
postgres=# create global temporary table gtt1 (c1 int unique); CREATE TABLE postgres=# create temporary table tmp1 (c1 int unique); CREATE TABLE
postgres=# create temporary table tmp2 (c1 int references gtt1(c1) ); ERROR: constraints on temporary tables may reference only temporary tables
postgres=# create global temporary table gtt2 (c1 int references tmp1(c1) ); ERROR: constraints on temporary tables may reference only temporary tables