Kill the sessions in postgresql
-> To get the active sessions use this query. cmd:select usename, pid, datname from pg_stat_activity; -> Now we can see the active sessions if we want to close all the connections to the particular database then use the cmd. cmd: SELECT pg_terminate_backend(pid)…
-> To get the active sessions use this query.
cmd:select usename, pid, datname from pg_stat_activity;

-> Now we can see the active sessions if we want to close all the connections to the particular database then use the cmd.
cmd:
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = ‘test_db’;

-> After the execution of this cmd we need to restart the application server to activate the session.
Write a query that shows each order status and how many orders have it — but only statuses with more than 1 order.