On Tue, Feb 6, 2018 at 6:03 PM, Michael Paquier <michael.paqu...@gmail.com> wrote: > I am not sure that we would like to give up that easily the property > that we have now to clean up past temporary files only at postmaster > startup and only when not in recovery. If you implement that, there is > a risk that the backend you are starting is eating the connection slot > and by consequence its temporary schema and its set of temporary tables > on which one may want to look into after a crash.
You can't actually do that from SQL, because as soon as you try to access your pg_temp schema, it'll be cleared out. All this changes does is move that forward from time-of-first-access to session start. That's a significant change that needs discussion, but I don't think it has the effect you are supposing. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company