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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay