Michael Paquier <mich...@paquier.xyz> writes: > Being able to relax a bit the case is better than nothing, so that's > nice to see incremental improvements. Thanks Dimitri.
I'm afraid that this patch is likely to be, if not completely broken, at least very much less useful than one could wish by the time we get done closing the holes discussed in this other thread: https://www.postgresql.org/message-id/flat/5d910e2e-0db8-ec06-dd5f-baec420513c3%40imap.cc For instance, if we're going to have to reject the case where the session's temporary schema was created during the current transaction, then that puts a very weird constraint on whether this case works. Also, even without worrying about new problems that that discussion may lead to, I don't think that the patch works as-is. The function every_on_commit_is_on_commit_drop() does what it says, but that is NOT sufficient to conclude that every temp table the transaction has touched is on-commit-drop. This logic will successfully reject cases with on-commit-delete-rows temp tables, but not cases where the temp table(s) lack any ON COMMIT spec at all. regards, tom lane