# check_connection

> **Function** in `langchain_azure_postgresql`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-postgresql/common/_connection/check_connection)

Check if the connection to Azure Database for PostgreSQL is valid and required extensions are installed.

:param conn: Connection to the Azure Database for PostgreSQL.
:type conn: Connection
:param required_extensions: List of required extensions to check if they are installed.
:type required_extensions: list[Extension]
:raises RuntimeError: If the connection check fails or required extensions are not installed.

## Signature

```python
check_connection(
    conn: Connection,
    /,
    required_extensions: list[Extension] = [],
)
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/607b649e909f217be20d7a50804ca11534c08eea/libs/azure-postgresql/src/langchain_azure_postgresql/common/_connection.py#L47)