DBA Hub

📋Steps in this guide1/1

View/modify connection limit of database

---View existing connection limit setting:( datconnlimit )

postgresql configurationintermediate
by PostgreSQL
13 views
1

View/modify connection limit of database

---View existing connection limit setting:( datconnlimit ) -- To set a specific limit for connection -- To restrict all the connections to db

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
postgres=# select datname,datallowconn,datconnlimit from pg_database where datname='test_dev';
-[ RECORD 1 ]--+------------
datname        | test_dev
datallowconn  | t.
datconnlimit  | -1.       -- >Means unlimited connections allowed
test_dev=# alter database test_dev connection limit 100;
ALTER DATABASE
test_dev=# alter database test_dev connection limit 0;
ALTER DATABASE
NOTE - > Even if connection limit is set to 0 , the superuser will be able to connect to database.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!