With this command I can terminate all connections running in a specific database.
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'DATABASE_NAME'
AND pid <> pg_backend_pid();
Is there a way to terminate connections in a certain schema only?
答案 0 :(得分:1)
No. PostgreSQL connections are always to a database, not to a schema.
Related question on dba.SE: