I am still a bit of a novice with PostgreSQL internals. Could you please provide some more detail on your comment regarding affecting permanent session state?
I was not referring to internals.
BEGIN; CREATE TEMP TABLE tempdo (id int); DO $$ BEGIN INSERT INTO tempdo VALUES (1); END; $$; SELECT * FROM tempdo; ROLLBACK;