Jim Jones <jim.jones@uni-muenster.de> writes:
> True. I just didn't expect this behavior to extend to temporary tables
> as well. It was just a bit surprising that a temporary table can persist
> after its owning session ends, simply because another session is holding
> a lock on it --- without the owning session being aware of that.
Actually the owning session is perfectly aware of that: it's waiting
on the lock to be released so it can finish dropping its temp tables.
The *client* likely isn't aware, because usually clients just close
the connection without waiting for end-of-session cleanup to happen.
regards, tom lane