Skip to content

Commit

Permalink
upd postgre
Browse files Browse the repository at this point in the history
  • Loading branch information
halyph committed Dec 8, 2023
1 parent 21ba8be commit c53c6af
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/wiki/howtos/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,19 @@ tags:
```shell
➜ psql -af myquery.sql
```

## Terminating long running connections

If you need to terminate a long running query or a connection e.g. because it is in IDLE in transaction admins can run:

```sql
select user_management.terminate_backend(<pid>);
```

Or to terminate all application connections:

```sql
select user_management.terminate_backend(pid)
from pg_stat_activity
where usename = 'your_application_user';
```

0 comments on commit c53c6af

Please sign in to comment.