> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# pg-listen-session

> A PostgreSQL listener connection can return to the pool while it is still subscribed.

## What it flags

`LISTEN` through `pg.Pool.query()` or an ordinary release of a visible local checkout that is still subscribed. PostgreSQL registers the connection that executes `LISTEN`, and notifications are delivered to that connection.

## How to review or fix

Retain one checked-out client for the listener's lifetime. Unsubscribe on that client before handing it back to the pool. Discard the connection when cleanup fails. Publishing with `NOTIFY` works through a transient checkout.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "pg-listen-session": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.