I intend to write a script to alert me when the number of connections active in my PostgreSQL server exceeds a certain threshold. Where can I find this number in a form I can use for comparison in a script?
My PostgreSQL version is 8.4.8, and my operating system is Debian Squeeze.