You can check connection details in Postgres using pgstatactivity. You can apply filter to satisfy your condition.
Spawn a container and jump right into a shell
The query to check number of connection to db and more details about activity
Enabling SSL for PostgreSQL in Docker
The way to restore backup db from terminal
In Terminal, you can use the GNU tar command to compress and uncompress files and folders. The usual file extension for a compressed tar archive is .tgz, although you might also see files ending with the .tar.gz extension. If the archive isn’t compressed, it usually just ends in .tar.