Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For even more fun, try "SELECT pg_cancel_backend(pid) from pg_stat_activity".

(DON'T ACTUALLY DO THIS on anything other than a personal test db as it will kill all the connections it has permission to kill)

Related, postgres has a number of different volatility options for functions so you can declare if there are side effects: https://www.postgresql.org/docs/14/xfunc-volatility.html These can become very important in some cases to let the optimizer have the freedom to shine.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: