Hello!
Temporary tables can get triggers in PostgreSQL.
Triggers are defined with a trigger function.
A temp table name is local to the current SQL session so there is no conflict with concurrent code doing the same CREATE TEMP TABLE mytable ...
However, user functions called by triggers are global to the schema and can enter in conflict...
What is the best practice, to avoid such issues?
I guess I could use some session id to build a unique function name.
But I would like to have that function dropped when the temp table is destroyed ...
Or, is there a way to define triggers directly with some anonymous code block?
Seb