On Thu, Feb 22, 2018 at 9:48 PM, Michael Paquier <mich...@paquier.xyz> wrote: > On Thu, Feb 22, 2018 at 11:24:37AM -0800, Andres Freund wrote: >> I suspect I'm going to get some grief for this, but I think the time has >> come to bite the bullet and support changing databases in the same >> process... > > I'd like to see that. Last time this has been discussed, and Robert > complained to me immediately when I suggested it, is that this is not > worth it with the many complications around syscache handling and > resource cleanup. It is in the long term more stable to use a model > where a parent process handles a set of children and decides to which > database each child should spawn, which is what autovacuum does.
My position is that allowing processes to change databases is a good idea but (1) it will probably take some work to get correct and (2) it probably won't be super-fast due to the need to flush absolutely every bit of state in sight that might've been influenced by the choice of database. I also agree with Andres that this email is not very easy to understand, although my complaint is not so much that I don't see how the parts relate as that you seem to be contradicting yourself. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company