PostgreSQL reconsiders its process-based model
PostgreSQL reconsiders its process-based model
Posted Jun 22, 2023 14:42 UTC (Thu) by kleptog (subscriber, #1183)Parent article: PostgreSQL reconsiders its process-based model
But nothing is final of course. There are of course benefits to be had too. But if this means I need to start managing more clusters then of course it's not helping at all. I guess it's a question of trust though in the end. And I do trust that if the postgres developers release a threaded version, then it will work as advertised.
That said, I wonder if a hybrid scheme is possible, where you can run multiple sessions threaded in parallel in a single process but limited to a single database. Then something like pgbouncer in front of it can handle the multiplexing. You could even add restrictions like: within a single process the GUCs must be the same and they all use the same loadable objects. I feel this would solve a lot of the use-cases where they're worried about the number of simultaneous processes. OTOH might be even more complex.
But whatever they do, the very best of luck.
Posted Jun 22, 2023 16:15 UTC (Thu)
by Lennie (subscriber, #49641)
[Link] (2 responses)
Same connection to PostgreSQL:
postgres=# \c testdb
Posted Jun 23, 2023 0:18 UTC (Fri)
by andresfreund (subscriber, #69562)
[Link] (1 responses)
That actually establishes a new connection from within psql and thus connects to a backend process. You can observe that with SELECT pg_backend_pid();.
Posted Jun 24, 2023 11:26 UTC (Sat)
by Lennie (subscriber, #49641)
[Link]
Posted Jun 23, 2023 3:01 UTC (Fri)
by willmo (subscriber, #82093)
[Link]
I think it depends on the bugs, and what you mean by “accidentally”. :-) I don’t think Postgres sandboxes the backend processes to protect against an attacker who gains arbitrary code execution? Still, it seems fair to assume that the practical impact of some bugs in some circumstances would be greater in a threaded model.
PostgreSQL reconsiders its process-based model
You are now connected to database "testdb" as user "postgres".
testdb=#
PostgreSQL reconsiders its process-based model
> ...
> postgres=# \c testdb
PostgreSQL reconsiders its process-based model
PostgreSQL reconsiders its process-based model
