On 2019-Jan-02, Tom Lane wrote:
> Maybe we ought to forbid prepared transactions from creating (or
> deleting?) any temp objects. I seem to remember that we already
> made some restrictions of that sort, but they clearly weren't
> sufficient to prevent all problems.
We make that check at transaction prepare time, but obviously there's no
way to do it any earlier since we don't know ahead of time whether the
transaction is going to do the normal commit/abort or become prepared.
Moreover, Dimitri has recently posted a patch[1] allowing prepared
transactions to commit if their temp tables are ON COMMIT DROP, which
conflicts with this approach. This seems problematic if the pg_temp_NN
entry is reused.
Maybe we should make temp namespace names more unique if we want to
add extra features :-(
[1] https://postgr.es/m/m2d0pllvqy.fsf@dimitris-macbook-pro.home
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services