Skip to content

Conversation

@zhanghaitao3
Copy link

This commit addresses an issue where releasing a connection back to the pool would trigger an UNLISTEN * command. This caused failures in GaussDB environments (specifically in Oracle compatibility mode) where the PostgreSQL LISTEN/NOTIFY mechanism is not supported.

Changes:

  1. Modified _detect_server_capabilities to identify GaussDB environments by checking for sql_mode in connection settings.
  2. Explicitly set notifications = False for these environments. This prevents the connection pool from attempting to execute UNLISTEN * during the cleanup/release phase.
  3. Ensured that standard PostgreSQL connections retain full LISTEN/UNLISTEN functionality.
  4. Re-enabled (unskipped) unit tests that were previously failing or skipped due to this incompatibility.

This commit addresses an issue where releasing a connection back to the pool would trigger an `UNLISTEN *` command. This caused failures in GaussDB environments (specifically in Oracle compatibility mode) where the PostgreSQL `LISTEN/NOTIFY` mechanism is not supported.

Changes:
1. Modified `_detect_server_capabilities` to identify GaussDB environments by checking for `sql_mode` in connection settings.
2. Explicitly set `notifications = False` for these environments. This prevents the connection pool from attempting to execute `UNLISTEN *` during the cleanup/release phase.
3. Ensured that standard PostgreSQL connections retain full `LISTEN/UNLISTEN` functionality.
4. Re-enabled (unskipped) unit tests that were previously failing or skipped due to this incompatibility.
The previous detection logic was insufficient for standard OpenGauss environments (e.g., A-compatibility or default modes) as it relied on keys like 'sql_mode' which may not exist.

Changes:
1. Updated `_detect_server_capabilities` to identify GaussDB/OpenGauss using the core parameter `session_respool`.
The previous detection logic was insufficient for standard OpenGauss environments (e.g., A-compatibility or default modes) as it relied on keys like 'sql_mode' which may not exist.

Changes:
1. Updated `_detect_server_capabilities` to identify GaussDB/OpenGauss using the core parameter `session_respool`.
@5xuanwen 5xuanwen merged commit 97c4632 into HuaweiCloudDeveloper:master Nov 29, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants