scripts: Don't terminate current session in terminate-psql-sessions.

This is a prep commit. Running terminate-psql-sessions command on
docker-zulip results in the script exiting with non-zero exit status
2. This is because the current session also gets terminated while
running terminate-psql-sessions command. To prevent that from happening
we don't terminate the session created by terminate-psql-sessions.
This commit is contained in:
Vishnu KS 2020-02-26 13:04:57 +05:30 committed by Tim Abbott
parent b40c8bd9cd
commit f2ce856b8f
1 changed files with 2 additions and 1 deletions

View File

@ -32,5 +32,6 @@ SELECT pg_terminate_backend(s.pid)
WHERE
s.datname IN ($tables)
AND r.rolname = CURRENT_USER
AND (s.usename = r.rolname OR r.rolsuper = 't');
AND (s.usename = r.rolname OR r.rolsuper = 't')
AND s.pid <> pg_backend_pid();
EOF