I'm trying to create a temporary table and use it with JOOQ.
Here's the query I use directly on DB and it works.
CREATE TEMPORARY TABLE temp_table_1
ON COMMIT DROP
AS
SELECT a1 FROM table1;
select * from func_uses_temp_table();
I tried to use
createTemporaryTable("t1").as(query).onCommitDrop().execute();
and then
fetch("select * from t1");
but it fails with message "jOOQ; bad SQL grammar [select * from t1]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t1" does not exist Position: 15"
So what would be the correct way to use temporary tables in queries?