I need to find out if a connection limit has been set on a Postgresql database on a per user basis.
I know you can set such a limit using:
ALTER USER johndoe WITH CONNECTION LIMIT 2;
Can you check this in the pg_users table?
PostgreSQL Connection Limits 15 connections are reserved for the superuser to maintain the state and integrity of your database, and 100 connections are available for you and your applications. If the number of connections to the database exceeds the 100-connection limit, new connections fail and return an error.
SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active'; Show activity on this post.
Using pgAdminIn the Browser pane, select our database (1) and then click on the Dashboard tab (2). In the bottom of page there is Server Activity panel which contain all connected sessions (3).
By default, PostgreSQL supports 115 concurrent connections, 15 for superusers and 100 connections for other users. However, sometimes you may need to increase max connections in PostgreSQL to support greater concurrency.
Whilst connected to the database you want to get this information
SELECT rolname, rolconnlimit FROM pg_roles WHERE rolconnlimit <> -1;
More details are available at http://www.postgresql.org/docs/current/static/view-pg-roles.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With