DEV Community

Dmitry Romanoff
Dmitry Romanoff

Posted on

4

How to limit the number of connections per DB in the PostgreSQL?

How to limit the number of connections per DB in the PostgreSQL?

alter database my_db connection limit 10;
Enter fullscreen mode Exit fullscreen mode

How to check the limit on the number of connections per DB in the PostgreSQL?

select datconnlimit from pg_database where datname='my_db';
Enter fullscreen mode Exit fullscreen mode

How to reset (i.e. return to default) the limit on the number of connections per DB in the PostgreSQL?

alter database my_db connection limit -1;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Quadratic

Python + AI + Spreadsheet

Chat with your data and get insights in seconds with the all-in-one spreadsheet that connects to your data, supports code natively, and has built-in AI.

Try Quadratic free

👋 Kindness is contagious

Value this insightful article and join the thriving DEV Community. Developers of every skill level are encouraged to contribute and expand our collective knowledge.

A simple “thank you” can uplift someone’s spirits. Leave your appreciation in the comments!

On DEV, exchanging expertise lightens our path and reinforces our bonds. Enjoyed the read? A quick note of thanks to the author means a lot.

Okay