2 ms·
The "straightforward" way to deal with this is a multi-year project. So, the reason is likely expense. The guts of the matter is that Postgres, and its extensi
by fdr 7y ago
The "straightforward" way to deal with this is a multi-year project. So, the reason is likely expense.
The guts of the matter is that Postgres, and its extensions, relies on a number of global variables. These global variables are more akin to a thread-local variable in multi-threaded programs, since there is one copy per forked backend. More nominally global state is carefully stored in shared memory.
The ramifications of changing this, e.g. to allow an execution state that can be cleanly suspended and resumed when scheduling, are rather large. Also, consider extensions, which to date could rely on their own global variables and connection termination exiting the entire process.
As-is, all the poolers have to live with obscure but important abnormalities where they cannot reset the process state quite properly, and that can be quite confusing. To eliminate this behavior is very expensive.