Greetings,
I've been doing some temporary tables and I created one with the same name of a permanent table. Maybe you should avoid temporary tablem creation for this case.
Best regards.
bxs=# CREATE TABLE test (x INT4);
CREATE
bxs=# SELECT CAST('45 SECONDS' AS INTERVAL) INTO TEMP test;
SELECT
bxs=# SELECT * FROM test;
?column?
----------
00:00:45
(1 row)
bxs=# \d test
Table "test"
Attribute | Type | Modifier
-----------+---------+----------
x | integer |
bxs=# INSERT INTO test VALUES (1);
ERROR: Attribute '?column?' is of type 'interval' but expression is of type 'int4'
You will need to rewrite or cast the expression
--------------------------------------------------------------------------------
José Vilson de Mello de Farias
Software Engineer